程序有时候能运行,有时候不能运行!!!!
最近用Delphi2010 开发了一个小程序,包括:两个组件、一个Dll ,在Dll中动态创建几个组件,另外写了一个测试程序(projec1.exe),用于调用Dll ,但是,不知道怎么回事,在按F9 以后,程序启动半截,就没有反应了,需要在进程里强制结束project1.exe;然而,有时候就成功运行了,真是郁闷!需要说明的时候,编译出来的程序,可以单独正常执行!
在调试运行时,总是运行到这(运行信息):Module Load:srvcli.dll . No Debug Info. Base Address:$75670000. Process project1.exe ,程序就不往下执行了!!!
只要一调这个接口函数——即使函数什么都不做,就会有问题:
procedure DisPlay_Init(AppHandle, ParentForm: HWND; width, Height: integer;
Conn: PConn; ServerIP, RemotePort: ShortString); stdcall;
begin
{ if FrmDisplay = nil then
FrmDisplay := TFrmDisplay.Create(nil);
FrmDisplay.ParentWindow := ParentForm;
FrmDisplay.Left := 0;
FrmDisplay.Top := 0;
FrmDisplay.width := width;
FrmDisplay.Height := Height;
FrmDisplay.AppHWND := AppHandle;
FrmDisplay.Init(Conn, ServerIP, RemotePort);
FrmDisplay.Show; }
end;