home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / win32 / 793 < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.0 KB  |  57 lines

  1. Newsgroups: comp.os.ms-windows.programmer.win32
  2. Path: sparky!uunet!microsoft!hexnut!johnhall
  3. From: johnhall@microsoft.com (John Hall)
  4. Subject: Re: NT, 3.1, and Global Memory
  5. Message-ID: <1992Sep02.180251.7874@microsoft.com>
  6. Date: 02 Sep 92 18:02:51 GMT
  7. Organization: Microsoft Corporation
  8. Keywords: global memory
  9. Lines: 43
  10.  
  11. In article baruch@nynexst.com (Robert Baruch) writes:
  12. | After reading countless paragraphs on how Windows supports only 
  13. | a few means of data transfer between applications, I have come to
  14. | the conclusion that if I didn't want to use DDE, I could use a DLL,
  15. | and GlobalAlloc memory which could then be shared between
  16. | all the applications using that DLL.
  17. | My questions are:
  18. | (1)  If I GlobalAlloc in the DLL, and get a handle using one application,
  19. |      then another application accesses this handle, will I get the data from
  20. |      the first application UNDER WINDOWS NT?  I know that it works
  21. |     under Windows 3.1.
  22.  
  23. No.  This won't work.
  24. However, I have just posted a dll which handles shared memory
  25. under Windows NT.  Operations are ShrAlloc(), ShrLock(),
  26. ShrUnlock(), ShrFree(), ShrName() to assign a name to a handle
  27. and ShrGet() to get a handle based upon a name.
  28.  
  29. I even make heroic efforts to force all addresses to be identical
  30. across processes.
  31.  
  32. This is available on Compuserve WIN32 porting from OS/2.
  33. Included in this kit is source code for the dll, test code,
  34. and some discussions on implementation decisions.  
  35.  
  36. I'll ask Alistair to place it on ftp.
  37.  
  38.  
  39. | (2)  Are global variables declared in a DLL shareable between
  40. |      applications under Windows NT?  Again, I know it works under 3.1
  41.  
  42. You can arrange for this to work.  See the example listed.
  43.  
  44. | (3)  If a DLL enters a message loop on behalf of an application, will
  45. |      that message loop receive messages posted to the application
  46. |      properly under NT?  Once again, it works under 3.1.
  47.  
  48. I don't see why not.
  49.  
  50. -- 
  51. -------------------------
  52. My comments are my own.  They are independent and unrelated to the
  53. views of my company , relatives or elected representatives.
  54.  
  55.