home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / tools / 1389 < prev    next >
Encoding:
Internet Message Format  |  1992-11-10  |  1.5 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.tools
  4. Subject: Re: What is the best way to get HINSTANCE of a DLL?
  5. Message-ID: <690@lax.lax.pe-nelson.com>
  6. Date: 10 Nov 92 23:06:12 GMT
  7. References: <1992Nov9.070214.3613@leland.Stanford.EDU>
  8. Sender: news@lax.pe-nelson.com
  9. Followup-To: comp.os.ms-windows.programmer.misc
  10. Distribution: usa
  11. Organization: PE-Nelson
  12. Lines: 21
  13.  
  14. In article <1992Nov9.070214.3613@leland.Stanford.EDU>, kmh@leland.Stanford.EDU (khanhmy hoang) writes:
  15. |> 
  16. |>     I am in an DLL and need to do a LoadString from the DLL's stringtable
  17. |>     and wonder what is the nicest way to get the HINSTANCE of the DLL to
  18. |>     use as LoadString's first argument.
  19.  
  20. The DLL is given its module handle (an HINSTANCE) as a parameter to LibMain.
  21. You should save this value in the data segment of the library to use for
  22. this purpose.
  23.  
  24. Methods that rely on a module handle being related in some way to DS are
  25. fraught with peril and are probably doomed when you port to NT.
  26.  
  27. NOTE: followups directed to comp.os.mw-windows.programmer.misc
  28.  
  29.  
  30. ----------------------------------------------------------------------------
  31. Tom Brown               |  "'ow d'you know 'e's a king?
  32. PE Nelson Systems       |            'cause 'e 'asn't got shit all over 'im!"
  33. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  34. ----------------------------------------------------------------------------
  35.