🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1827

DosQueryProcAddr()

#1827
From: Mike King
Date: Wed, 11 Nov 1992 01:29
16 lines
1163 bytes
Hello out there, 
   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.

Thanks for any pointers.
Technical Details
Message-ID: <1992Nov11.012959.27956@borland.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!sun-barr!decwrl!borland.com!mking

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.os2.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!sun-barr!decwrl!borland.com!mking
From: mking@borland.com (Mike King)
Subject: DosQueryProcAddr()
Message-ID: <1992Nov11.012959.27956@borland.com>
Originator: mking@genghis.borland.com
Sender: news@borland.com (News Admin)
Organization: Borland International
Date: Wed, 11 Nov 1992 01:29:59 GMT
Lines: 17