很难非高手勿进¥¥¥¥delphi 调用dll中form 的执行顺序与存储过程的使用问题¥¥¥¥
extern "C" __declspec(dllexport) int __stdcall showBBCGXQMX();
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
switch(reason)
{
case DLL_PROCESS_ATTACH:
CoInitialize(NULL);
break;
case DLL_PROCESS_DETACH:
CoUninitialize();
break;
}
return 1;
return 1;
}
//-----------------------C++中调用form的函数----------------------------------------------------
int __stdcall showBBCGXQMX()
{
TBBCGXQMXForm1 * BBCGXQMXForm1;
Application->CreateForm(__classid(TBBCGXQMXForm1), &BBCGXQMXForm1);
//BBCGXQMXForm1->ADOConnection1->Connected =1;
BBCGXQMXForm1->ShowModal() ;
return 1;
}
//------------------delphi调用部分
var
InvMoudle:Thandle;
conStr:string;
tes:integer;
begin
begin
//BB_BPShiJianForm1.ShowModal ;
InvMoudle:=LoadLibrary('BBCGXQMXdllProject1.dll');
if invMoudle<>0 then
begin
Show_KuCunTZ:=GetProcAddress(InvMoudle,'showBBCGXQMX');
Show_KuCunTZ;
showMessage('hello');
end else
begin
showMessage('您没有安装相应的模块!');
end;
end;
--------------------
我的问题是:
1。 为什么我在dll中明明用的BBCGXQMXForm1->ShowModal() ; 为什么程序执行起来却不是modal
模式。
2。为什么delphi调用的Show_KuCunTZ; 后直接就跑到下一条语句了showMessage('hello'); 而得delphi 自己写的相同代码却是关了那个dll中的form 后再执行下一条呢??
3。 为什么我关闭dll中的form的时候系统就报错,而且一执行存储过程就报错呢??