home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / smalltal / 2797 < prev    next >
Encoding:
Text File  |  1993-01-22  |  1.3 KB  |  35 lines

  1. Newsgroups: comp.lang.smalltalk
  2. Path: sparky!uunet!portal!magus
  3. From: magus@shell.portal.com (Magus Company)
  4. Subject: How can I test for an opened DLL in Smalltalk/V 2.0 in OS/2?
  5. Message-ID: <C19MM7.28M@unix.portal.com>
  6. Sender: news@unix.portal.com
  7. Nntp-Posting-Host: jobe
  8. Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
  9. Date: Fri, 22 Jan 1993 17:15:43 GMT
  10. Lines: 23
  11.  
  12. I'm using Smalltalk/V PM 2.0 (for OS/2 2.0) to call functions in a C DLL. 
  13. No problem so far.  The DLL is accessed by sending an open message to its
  14. subclass of DynamicLinkLibrary, and has its unique instance (a PMHandle)
  15. assigned to a global variable, say VAR.  The DLL requires that I call an
  16. internal initialization routine after I open it, but only once.  
  17.  
  18. Question: How can my application tell if the DLL has already been opened? 
  19. If my application calls the DLL initialization routine a second time by
  20. mistake, an error message appears.  I can't do something like
  21.  
  22. VAR isNil ifTrue: [MyDLL open]
  23.  
  24. since VAR is global and remains defined between program loads.  Nor have I
  25. figured out a way to do what I need with instance variables.  Can someone
  26. shed some light here?
  27.  
  28. Thanks in advance.
  29.  
  30. ---
  31. Kevin W. Thompson                          415-940-1109
  32. President                                  800-848-8037
  33. thompson@magus.com                         415-940-1238 Fax
  34.  
  35.