I am having some trouble with DosQueryProcAddr(), and I was wondering if anyone had a piece of code they could share. I am tring to get the address of a 16-bit function in a 16-bit DLL. The DosLoadModule() seems to work fine, and the call to DosQueryProcAddr() returns a 0 as well. When I try to execute the function I get an error.
Here is one of the variations I have tried:
static USHORT usVar;
USHORT __far16 __pascal (*func)(USHORT *);
/* some stuff deleted */
if (!DosLoadModule(NULL, 0, "mod", &hDllHandle))
{
if (!DosQueryProcAddr(hDllHandle, (ULONG)0, "FUNCTION",
(PFN *)&func))
{
if (!func(&usVar)) <== It dies here.
I tried the examples in the C/SET but they didn't help.