home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1588 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  2.1 KB

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