Click here to Skip to main content
15,917,608 members

Comments by DarkKobold (Top 4 by date)

DarkKobold 14-Mar-11 18:28pm View    
I had set the DLL wrapper to STDCALL. It turns out that I needed to make sure it was _CDECL calling convention. Thanks for all the help, Olivier!
DarkKobold 9-Mar-11 17:22pm View    
Olivier - Wow, thank you for doing so much research. Unfortunately, that manual has quite a few errors in it, as many functions don't match the calls performed in the SDK. I copied, verbatim, the function calls in their SDK example, (which is a Visual C++ app), and everything works fine except for this one last piece, the callback. (I also tried changing the function call to the one listed in the manual, to no avail.) Also, I am able to compile their example application, and the callback works fine. This is why I think it has something to do with it being wrapped inside a DLL... Do DLLs need something special to have callbacks?

Anyway, I contacted the company to let them know of these errors in the manual, as well as my question about the callback. I understand if you can't help any further, and thanks for everything you've done.

EDIT: Actually, I was thinking about it - maybe I need to send the function address from C#, as a delegate? If somehow it can't address the function inside the DLL, I can send it the same function from C# itself? I have no idea how to do that, but I'm totally lost otherwise.
DarkKobold 8-Mar-11 15:12pm View    
Yes, that returns succeeded as well, as long as the callback assignment is commented out. The only thing that causes the crash is assigning the callback.
DarkKobold 8-Mar-11 11:46am View    
Sorry, I left this out to make an easier read.
hDll = LoadLibrary(TEXT("D:\\WINDOWS\\system32\\DVP7010B.dll"));
if (hDll)
{
AdvDVP_CreateSDKInstence = (ptr_func1)GetProcAddress(hDll, (LPCSTR)"AdvDVP_CreateSDKInstance");
}
else return 2;

if (AdvDVP_CreateSDKInstence)
{
ErrorVal = AdvDVP_CreateSDKInstence((void **)&pDVPSDK);
if (ErrorVal != SUCCEEDED)
return ErrorVal;
}

Also, I am on a 32bit OS, as the driver for this video card only works in 32bit XP.