花
花园风味
Unregistered / Unconfirmed
GUEST, unregistred user!
我在我的Dll(MDI加载Dll)的窗体中,ShowHint,会出错!
“Exception EConvertError in ...”
气死我了!怎么搞?!遇到过吗?给点建议!谢谢!
附:dll代码
library testDlls001;
uses
SysUtils,
Classes,
Windows,
Forms,
DevShare,
Unt_Child in 'Unt_Child.pas' {FrmChild001};
{$R *.RES}
var
OldApplication: TApplication;
OldScreen: TScreen;
procedure DLLEntryPoint(dwReason : DWord);
begin
case dwReason of //此处还可以加入线程入口
DLL_PROCESS_ATTACH: //载入DLL
begin
OldApplication := Application;
OldScreen := Screen;
end;
DLL_PROCESS_DETACH: //卸载DLL
begin
Application := OldApplication;
Screen := OldScreen;
end;
end;
end;
//// 运行DLL主窗口 //////////////////////////////////////
procedure RunApp(param: TDLLParam); stdcall;
begin
dllParam := param; //获取参数
Screen := param.scr;
Application := param.app;
FrmChild001 := TFrmChild001.Create(Application); //to do: 将DllForm修改为你的
end;
//// 显示DLL主窗口 //////////////////////////////////////
procedure ShowApp; stdcall;
var
i: Integer;
ccFind: Boolean;
begin
ccFind := False;
for i := 0 to Application.MainForm.MDIChildCount - 1 do
if Application.MainForm.MDIChildren.Name = FrmChild001.Name then //to do: 将DllForm修改为你的
begin
ccFind := True;
Break;
end;
if not ccFind then
FrmChild001 := TFrmChild001.Create(Application);
FrmChild001.BringToFront;
end;
//////////////////////////////////////////////////////////////////////
exports
RunApp, ShowApp;
begin
DLLProc := @DLLEntryPoint;
DLLEntryPoint(DLL_PROCESS_ATTACH);
end.
在FrmChild001中只要ShowHint就会出错!
但是TreeView自身的ShowHint没错!:(
郁闷!
急!
“Exception EConvertError in ...”
气死我了!怎么搞?!遇到过吗?给点建议!谢谢!
附:dll代码
library testDlls001;
uses
SysUtils,
Classes,
Windows,
Forms,
DevShare,
Unt_Child in 'Unt_Child.pas' {FrmChild001};
{$R *.RES}
var
OldApplication: TApplication;
OldScreen: TScreen;
procedure DLLEntryPoint(dwReason : DWord);
begin
case dwReason of //此处还可以加入线程入口
DLL_PROCESS_ATTACH: //载入DLL
begin
OldApplication := Application;
OldScreen := Screen;
end;
DLL_PROCESS_DETACH: //卸载DLL
begin
Application := OldApplication;
Screen := OldScreen;
end;
end;
end;
//// 运行DLL主窗口 //////////////////////////////////////
procedure RunApp(param: TDLLParam); stdcall;
begin
dllParam := param; //获取参数
Screen := param.scr;
Application := param.app;
FrmChild001 := TFrmChild001.Create(Application); //to do: 将DllForm修改为你的
end;
//// 显示DLL主窗口 //////////////////////////////////////
procedure ShowApp; stdcall;
var
i: Integer;
ccFind: Boolean;
begin
ccFind := False;
for i := 0 to Application.MainForm.MDIChildCount - 1 do
if Application.MainForm.MDIChildren.Name = FrmChild001.Name then //to do: 将DllForm修改为你的
begin
ccFind := True;
Break;
end;
if not ccFind then
FrmChild001 := TFrmChild001.Create(Application);
FrmChild001.BringToFront;
end;
//////////////////////////////////////////////////////////////////////
exports
RunApp, ShowApp;
begin
DLLProc := @DLLEntryPoint;
DLLEntryPoint(DLL_PROCESS_ATTACH);
end.
在FrmChild001中只要ShowHint就会出错!
但是TreeView自身的ShowHint没错!:(
郁闷!
急!