Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {============================ ProjectEXE.dpr ============================}
- program ProjectEXE;
- uses
- ShareMem{!!!}, Windows;
- function Example(const lpText: PChar): BOOL; export; stdcall;
- begin
- Result := (lpText <> nil);
- if Result then
- MessageBox(0, lpText, 'Example', MB_ICONINFORMATION);
- end;
- procedure LoadDLL;
- var
- hLib : DWORD;
- begin
- hLib := LoadLibrary('ProjectDLL.dll');
- if hLib <> 0 then
- FreeLibrary(hLib)
- else
- MessageBox(0, 'Can''t load DLL', 'Error', MB_ICONERROR);
- end;
- exports
- Example name 'Example';
- begin
- LoadDLL;
- end.
- {============================ uExportEXE.pas ============================}
- unit uExportEXE;
- interface
- uses
- Windows;
- function Example(const lpText: PChar): BOOL; stdcall;
- external 'ProjectEXE.exe' name 'Example';
- implementation
- end.
- {============================ ProjectDLL.dpr ============================}
- library ProjectDLL;
- uses
- ShareMem{!!!}, uExportEXE;
- begin
- Example('EXE export example');
- end.
Add Comment
Please, Sign In to add comment