|
| 02 Jun 2013 12:12 AM |
For some odd reason when I try to call a function in a DLL, I get some dumb buffer overrun and internal corruption thing. I set a breakpoint on when the function is called in the DLL from the main program. I've been trying to figure out why the pointer is becoming invalid.
This is the piece of line that calls: ((int (__stdcall *)(HINSTANCE, HINSTANCE, LPCWSTR, int))ent)(hIns, hPre, (LPCWSTR)lpCom, show)
And this is the function being called (in the external DLL): signed int __stdcall LauncherMain(HINSTANCE hIns, HINSTANCE hPrev, LPCWSTR lpcom, int show)
But the pointer shows up as invalid (points to 0 or 0x706f746b)
Any reason why? |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 12:32 AM |
| Hmmmm, now the function pointer is null when I checked again. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 12:36 AM |
| Apparently GetProcAddress(lib, "LauncherMain") returns null?? |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 12:50 AM |
| Ok, I got the GetProcAddress issue fixed, but the lpCmd parameter (taken from the 3 argument in WinMain) is still a bad pointer. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 01:14 AM |
| So I fixed the error in the argument call, but now it gives the overrun error at the very end of the program right before it exits. |
|
|
| Report Abuse |
|
|
itunes89
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 1957 |
|
|
| 02 Jun 2013 03:50 AM |
| Nice conversation with yourself... |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 03:52 AM |
| I like pointers, they're useful. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2013 10:25 AM |
| Okay, but can anyone help with the overrun error upon exit? I set a break point on the very last line, and the only thing left on the stack is 0 (the result value) for the return value. But when it exits, it gives me the overrun error. |
|
|
| Report Abuse |
|
|