- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have a Fortran EXE making calls into a Fortran DLL. I have a DLLMain routine defined in the DLL, which performs initialisation stuff when the DLL gets loaded. I can set a breakpoint, and see this occurring.
But when I build theDLL and EXE both to 64-bit, the breakpoint in DLLMain is not hit. The initialisation never gets performed, and so all the other DLL methods don't work as intended. Can someone please enlighten me as to the way to define a 64-bit DLLMain method?
Cheers,
Grant
I have a Fortran EXE making calls into a Fortran DLL. I have a DLLMain routine defined in the DLL, which performs initialisation stuff when the DLL gets loaded. I can set a breakpoint, and see this occurring.
But when I build theDLL and EXE both to 64-bit, the breakpoint in DLLMain is not hit. The initialisation never gets performed, and so all the other DLL methods don't work as intended. Can someone please enlighten me as to the way to define a 64-bit DLLMain method?
Cheers,
Grant
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is how I managed to define a DllMain procedure so that it works in both 32-bit and 64-bit.(Idea stolen from variousfunctions defined inifmt.f90).
logical(BOOL) function DllMain(hinstDll, fdwReason, lpvReserved)
!DEC$ ATTRIBUTES DEFAULT,DECORATE,STDCALL,ALIAS: "DllMain" :: DllMain
integer(HANDLE), intent(in) :: hinstDll
integer(DWORD), intent(in) :: fdwReason
integer(LPVOID), intent(in) :: lpvReserved

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page