From: Ricardo S. <rik...@gm...> - 2007-01-18 12:47:26
|
Hi, I have a problem using the C++ wrapper's DLL in C# due to some exceptions. The DLL is created with the files generated by swig and linked with my project and other additional libs. I activated the unmanaged debug in the C# project and when I run it I'll get: System.TypeInitializationException: The type initializer for 'vectorPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'vector': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at vectorPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_vector(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, etc...... Basically it says it can't load the vector.dll but the file is there, the thing is that before it gives this exception, the application tries to load the vector.dll and all other dll's that are necessary but at some time it gives me an unmanaged exception: Entry Point Not Found. I configure the IDE to stop at this exception and I traced it to this line: SWIGRegisterExceptionCallbacks_vector(applicationDelegate, arithmeticDelegate, divideByZeroDelegate, indexOutOfRangeDelegate, invalidCastDelegate, invalidOperationDelegate, ioDelegate, nullReferenceDelegate, outOfMemoryDelegate, overflowDelegate, systemDelegate); and the declaration is: [DllImport("vector", EntryPoint="SWIGRegisterExceptionCallbacks_vector")] public static extern void SWIGRegisterExceptionCallbacks_vector(...); After this the app unloads the vector.dll and all the DLL's that it depends on. It tries to load again for more 3 or 4 times giving the same exception every time. I checked the DLL through the dependecy walker application and the function name is exported as: _SWIGRegisterExceptionArgumentCallbacks_vector@12 This is as far as I went to find the root of problem but I've been around this for some time now and can't get it to work. I ran some searches in the mailing list archive and I got some results but didn't help me with this issue. Thank you for any help you can give me. Ricardo Sabino. |