program Project1; {$APPTYPE CONSOLE} uses Windows; var fnSomeDllMethod:procedure() cdecl; m_hDll: HMODULE; type TCALLBACKPROC = function(arg:Pointer):HRESULT stdcall; type TSetCallbackFunc = procedure(_proc:TCALLBACKPROC) cdecl; var fnSetCallback:TSetCallbackFunc; function CallbackProc(wEvent:DWORD;arg:Pointer;pParam:Pointer):HRESULT stdcall; begin MessageBoxA(0,'delphi', 'delphi',MB_OK); end; begin { TODO -oUser -cConsole Main : Insert code here } begin begin m_hDll := LoadLibrary('DLLMsgBox.dll'); fnSetCallback := GetProcAddress(m_hDll,'DisplayInMessageBox'); fnSetCallback(CallbackProc); FreeLibrary(m_hDll); end; end; end.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)