- Sep 19, 2000
- 10,283
- 134
- 106
Ok, I don't know if this qualifies as advanced or whatever. Here is the problem I am having. I have a pascal function that looks like this
"Function CreateTPAFromBMP( BmpDC : HDC): TPointArray;Stdcall;"
It is available in a dll and accessible through a LoadLibrary/LoadProc combination. The problem is that whenever I try (through the many methods I've tried) to call this function from c++ I get a segfault and crash.
What should the C++ function definition look like? I have tried
typedef POINT* (*CTFB)(HDC) __attribute((stdcall));
....
CTFB CreateTPAFromBMP = (CTFB)LoadProc(Handle, "CreateTPAFromBMP");
CreateTPAFromBMP(GetDC(GetDesktopWindow()));
with no luck.
I am sure the call is working as well as I have been able to load other functions without too much trouble.
"Function CreateTPAFromBMP( BmpDC : HDC): TPointArray;Stdcall;"
It is available in a dll and accessible through a LoadLibrary/LoadProc combination. The problem is that whenever I try (through the many methods I've tried) to call this function from c++ I get a segfault and crash.
What should the C++ function definition look like? I have tried
typedef POINT* (*CTFB)(HDC) __attribute((stdcall));
....
CTFB CreateTPAFromBMP = (CTFB)LoadProc(Handle, "CreateTPAFromBMP");
CreateTPAFromBMP(GetDC(GetDesktopWindow()));
with no luck.
I am sure the call is working as well as I have been able to load other functions without too much trouble.