Calling Other DLLS from VC application
-
Appologies for not posting this on VC++ message board ( the link was timing out) I am trying to call a DLL written in Fortran from my VC++ application. Everything works fine, but when the Fortran DLL runs into trouble (some exception occurs in the FOrtran DLL) I see a dangerous looking Dialog Box, given the stack trace and the VC application simply exits. I have tried enclosing Fortran DLL function call with both try-catch and __try__except blocks, but the code in the catch/except never gets executed. Is there any way to catch Exceptions raised in FOrtran DLL in the calling VC++ applications. Any help will be greatly appreciated. cheers, kashif manzoor peace to all
-
Appologies for not posting this on VC++ message board ( the link was timing out) I am trying to call a DLL written in Fortran from my VC++ application. Everything works fine, but when the Fortran DLL runs into trouble (some exception occurs in the FOrtran DLL) I see a dangerous looking Dialog Box, given the stack trace and the VC application simply exits. I have tried enclosing Fortran DLL function call with both try-catch and __try__except blocks, but the code in the catch/except never gets executed. Is there any way to catch Exceptions raised in FOrtran DLL in the calling VC++ applications. Any help will be greatly appreciated. cheers, kashif manzoor peace to all
try/catch
and__try/__except
blocks are setting per thread exception frames , so your Fortran dll may spawns another threads that may throw the unhandled exceptions you are faced. Try to set a proccess wide exception filter that will exceutes as the last recover to the unhandled exceptions that may be thrown by your dll. the key function is the Win32 SetUnhandledExceptionFilter function. I hope it works for you. AbuMalek