Hi, my program is composed by an exe and several DLLs. When an exception is raised in a DLL, I'would like to know which dll filename is in error (I need to customize some mantis sending parameters related to this filename). I'm trying to get it with exceptIntf.Module but it returns always the main exe module handle. Is it something possible to achieve?
Thank you
Davide
How to get at runtime the filename of a dll in error?
Re: How to get at runtime the filename of a dll in error?
Usually it's the EXE which does the exception handling, that's why your try didn't work. What you can do is check the crash address (exceptIntf.ExceptAddr). You can use "madTools.FindModule" to get the DLL/EXE name that owns the ExceptAddr. That could be your DLL, or your EXE. But it could also be a system DLL. So for a "perfect" solution you would have to browse through the crash callstack and find the first entry that belongs to one of your DLLs or EXE. You can do that by analyzing exceptIntf.Callstacks[0].