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