B
BeginDelphi
Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi中,DLL怎麽實現VC中的DllEntry?Help中說,可以用DllProc,但怎麽不行?<br>library SimpleDll;<br>uses Sysutils,math,dialogs;<br>procedure DllMain(Reason: Integer);<br>begin<br> case Reason of<br> 0: ShowMessage('DLL_PROCESS_DETACH');<br> 1: ShowMessage('DLL_PROCESS_ATTACH');<br> 2: ShowMessage('DLL_THREAD_ATTACH');<br> 3: ShowMessage('DLL_THREAD_DETACH');<br> end;<br>end;<br>function Min(const Int1, Int2: Int64): Int64; stdcall; export;<br>begin<br> Result := ifthen(Int1 > int2, int1, int2);<br>end;<br>exports<br> Min;<br>begin<br> DllProc :=@DllMain;<br> DllProcEx:=@DllMain;<br>end.<br><br>還有,Delphi中的API很不全,比如IMM.pas,比起VC的IMM.h少很多東西。