I built a FORM in the DLL
In the Form with the Create event added
Application. The OnMessage:=WMDropMessage;
Procedure Tfm_TS. WMDropMessage (var Msg: TMsg; Var Handled: Boolean);
Var
.
The begin
.
end;
When the exit times wrong, how to solve????????????????
CodePudding user response:
What's wrong??CodePudding user response:
Application of DLL is set to the caller ApplicationCodePudding user response:
You stick WMDropMessage,,CodePudding user response:
Attention, leave footprints, take very every dayCodePudding user response:
This Dll is loaded dynamically,The function openDllModal (DLLName: string; ProcName: string; Vhand: THandle) : THandle; Stdcall;
Type
TDllModalFun=function (hand: THandle) : THandle; Stdcall;
Var
DLLHandle: THandle;//handle to the DLL
PDll: Pointer;
VHd: THandle;
The begin
Try
DLLHandle:=LoadLibrary (PChar (' Modal \ '+ DLLName));
If DLLHandle & gt; 0 then
The begin
PDll:=GetProcAddress call (DLLHandle, PChar (ProcName));
If pDll & lt;> Nil then
The begin
Try
//Result:=TDllModalFun (pDll) (vhand);
VHd:=TDllModalFun (pDll) (vhand);
Result:=vHd;
Except,
On e: the Exception do
The begin
DisplayMessage (' error ', 'execution' + ProcName + 'error function! '+ # 13 + e.M essage);
The Exit;
end;
end;
End the else
The begin
DisplayMessage (' error 'and' load the DLL function error! ');
The Exit;
end;
End the else
The begin
DisplayMessage (' error 'and' access to handle to the DLL error! ');
The Exit;
end;
The finally
//FreeLibrary (DLLHandle);
end;
end;
//FreeLibrary (DLLHandle);
The screen is not an error
This is
Procedure Tfm_TS. WMDropMessage (var Msg: TMsg; Var Handled: Boolean);
Var
WMD: TWMDropFiles;
VWinControl: TWinControl;
The begin
Case Msg. The message of
WM_DROPFILES:
The begin
VWinControl:=FindControl (Msg. HWND);
//ShowMessage (vWinControl. Name + 'send message').
end;
end;
If the Msg. Message=WM_DROPFILES then
The begin
WMD. Msg:=Msg. The message;
WMD. Drop:=Msg. WParam;
WMD. Unused:=Msg. LParam;
WMD. Result:=0;
WMDropFiles (WMD);
Handled:=TRUE;
end;
end;
CodePudding user response: