home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.ms-windows.programmer.misc:1588 comp.os.ms-windows.programmer.win32:744
- Newsgroups: comp.os.ms-windows.programmer.misc,comp.os.ms-windows.programmer.win32
- Path: sparky!uunet!europa.asd.contel.com!news.ans.net!nynexst.com!gallifrey!baruch
- From: baruch@nynexst.com (Robert Baruch)
- Subject: DLLs and Message Loops
- Message-ID: <1992Aug31.132434.3593@nynexst.com>
- Followup-To: NO! no follow up! xrn doesn't seem to have a 'post' button!
- Keywords: DLL message task
- Sender: baruch@gallifrey (Robert Baruch)
- Organization: NYNEX Science and Technology
- Date: Mon, 31 Aug 92 13:24:34 GMT
- Lines: 33
-
-
- I have been agonizing over this for a week now, and all the books I've
- read on the subject seem to tell me that "DLLs don't do that", in
- pretty much the same words.
-
- Here's the problem:
-
- I have a DLL of functions which make writing my application very easy.
- After all, that's what DLLs are good for, among other things. The problem
- is, I want most of these DLL functions to be blocking. That is, if a function
- fails, and it may succeed later on (due, for example, to low memory
- conditions), I want to sit around within that function, yielding control
- to other applications, getting back control, trying again, and so on.
-
- The trouble is this. Because I want development of my applications to
- be made as easy as possible for the end user, I want to keep the code
- the user has to write down to a minimum. The user will write his
- own WndProc for the main window, and he'll also write the WinMain.
- But when he calls my DLL function, the DLL may have to yield control
- to other applications as above. SO: Can I put a message loop in the DLL,
- which will then call the WndProc of the correct application? I realize
- that DLLs are non-tasked executables, so what happens if I put
- a GetMessage or PeekMessage in a DLL? OR, can I have the DLL IMPORT
- a function from the application which does the message loop? OR,
- do none of these adhere to strict guidelines, making the code unportable
- to Windows NT, and if so, how do I do what I need to do?
-
- Thanks in advance,
-
- --Rob
-
- PS, I'm using Borland C for Windows, so Microsoft C switches, etc
- are fairly useless to me!
-