exception - C++ Access Violation while calling dll function -


I'm actually using an unmanaged C ++ DLL, and I have .h, .cpp or .lib Do not have access to, but only for DLL

After using the PE Explorer and to find the function I wanted to use, here is what I get:

  @ Tdtm_Dossier @ logon $ qv; Index 1310; Unmangled Borland C ++ function: Qualified function Tdtm_Dossier :: Logon ()  

And here's what I get by using the dumpbin :

< Pre> 1310 11F 9 00105234 @ TDMDesier @ logon $ qv

The exception is here:

  in functions on 0x034b258c (modDll.dll) Unconfirmed Exception CPP.XA: wrx access violation to 0xC0000005: 0x000000AC  

I am using this function to call and use, follow this type:

  #include & lt; Stdio.h & gt; # Include & lt; Windows.h & gt; # Include & lt; Iostream & gt; Typingfaces (* logon) (); Int main () {HMODULE modDll; Ent Funnel Logon; ModDll = Load Library ("C: \\ dll \\ modDll.dll"); Logon logon; Logon = (Logon) GetProcAddress (modDll, "@ Tdtm_Dossier @ Logon $ qv"); If (logon) {resultLogon = logon (); // & lt; - This is where I get the exception printf ("the function is loaded \ n"); } Else // TODO: Error Message FreeLibrary (modDll); }  

Since the DLL documentation does not give me any interesting information about using the function, so I can not trust it

DLL Loading correctly and GetProcAddress returns something I think (but I'm not sure) that this is something to do with my typedef , but I do not know What is the return type of this function can be.

If you read the example, you can understand that the name of the symbol "@ Tdtm_Dossier @ Logon Represents a non-static member function of $ qv " class Tdtm_Dossier . You can not call non-static member functions like normal tasks, they have a hidden first argument which makes the this indicator in the member faculty.

What's happening here Maybe is that the logon member attempts to use the member variable of the object object, none of which Which has undefined behavior and crashes.

You need the header file and the link library to use this library. You can only call the function (member or not) and hope for the best.


Comments