home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / programm / 6326 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.1 KB  |  29 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!think.com!ames!sun-barr!decwrl!borland.com!mking
  3. From: mking@borland.com (Mike King)
  4. Subject: DosQueryProcAddr()
  5. Message-ID: <1992Nov11.012959.27956@borland.com>
  6. Originator: mking@genghis.borland.com
  7. Sender: news@borland.com (News Admin)
  8. Organization: Borland International
  9. Date: Wed, 11 Nov 1992 01:29:59 GMT
  10. Lines: 17
  11.  
  12. Hello out there, 
  13.    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.
  14.    Here is one of the variations I have tried:
  15. static USHORT usVar;
  16. USHORT __far16 __pascal (*func)(USHORT *);
  17.    /* some stuff deleted */
  18. if (!DosLoadModule(NULL, 0, "mod", &hDllHandle))
  19. {
  20.    if (!DosQueryProcAddr(hDllHandle, (ULONG)0, "FUNCTION",
  21.       (PFN *)&func))
  22.    {
  23.       if (!func(&usVar))   <== It dies here.
  24.      
  25.   I tried the examples in the C/SET but they didn't help.
  26.  
  27. Thanks for any pointers.
  28.  
  29.