各位大哥,程序写不下去了,帮帮我

cqbonny 2003-12-19 09:51:00
为什么我写findclass(TForm1)的时候,程序老是出错,给我说“class TForm1 not found”,怎么办,现在不知道了。

我在线等待……
...全文
47 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqbonny 2003-12-19
  • 打赏
  • 举报
回复
谢谢,我搞定了,放分
cqbonny 2003-12-19
  • 打赏
  • 举报
回复
我再试试???
swayi21 2003-12-19
  • 打赏
  • 举报
回复
In the unit declarationing TForm1

initialization
RegisterClass(TForm1);

That is ok.
ln521 2003-12-19
  • 打赏
  • 举报
回复
老兄我给你试过了
没有错误呀
你的openwindow是一个窗体吧?
cqbonny 2003-12-19
  • 打赏
  • 举报
回复
但是这个怎么注册其他的类呢?
herofy 2003-12-19
  • 打赏
  • 举报
回复
Call FindClass to locate a class type by name. FindClass searches the classes that the streaming system knows about. Form classes and component classes that are referenced in a form declaration (instance variables) are automatically registered with the streaming system. Other classes can be registered (with a call to RegisterClasses) so that the streaming system will recognize that class in a stream and know how to construct it.
我没看怎么懂,好像是说,只能查找到系统的类,如果想查到其它的类必须要注册!
cqbonny 2003-12-19
  • 打赏
  • 举报
回复
各位大哥,程序写不下去了,帮帮我
cqbonny 2003-12-19
  • 打赏
  • 举报
回复
没有人知道么?自己先顶一下
我等
cqbonny 2003-12-19
  • 打赏
  • 举报
回复
function TFrm_Main.Prf_RunListProc(As_FormName: string): Integer;
var
FcType: TFormClass;
Frmname: string;
begin
try
Frmname := 'T' + As_FormName;
FcType := TFormClass(FindClass(Frmname));//-------这里报错
if Assigned(OpenWindow) then
OpenWindow.Free;
Application.CreateForm(Fctype, OpenWindow);
OpenWindow.Showmodal;
except
ShowMessage('该功能目前无法使用!');
Result := -1;
end;
Result := 0;
end;
yurenjf 2003-12-19
  • 打赏
  • 举报
回复
你在哪里写的,把代码帖出来看看...

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧