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

  1. Newsgroups: comp.os.ms-windows.programmer.win32
  2. Path: sparky!uunet!pipex!demon!edscom!kevin
  3. From: kevin@edscom.demon.co.uk (Kevin Broadey)
  4. Subject: Re: NT, 3.1, and Global Memory
  5. In-Reply-To: johnhall@microsoft.com's message of 02 Sep 92 18:02:51 GMT
  6. Message-ID: <KEVIN.92Sep4095239@runningbear.edscom.demon.co.uk>
  7. Sender: kevin@edscom.demon.co.uk (Kevin Broadey)
  8. Organization: EDS-Scicon, Milton Keynes, UK
  9. References: <1992Sep02.180251.7874@microsoft.com>
  10. Date: Fri, 4 Sep 1992 09:52:39 GMT
  11. Lines: 56
  12.  
  13. >>>>> Regarding Re: NT, 3.1, and Global Memory; johnhall@microsoft.com
  14. >>>>> (John Hall) adds:
  15.  
  16. In article baruch@nynexst.com (Robert Baruch) writes:
  17.  
  18. | After reading countless paragraphs on how Windows supports only 
  19. | a few means of data transfer between applications, I have come to
  20. | the conclusion that if I didn't want to use DDE, I could use a DLL,
  21. | and GlobalAlloc memory which could then be shared between
  22. | all the applications using that DLL.
  23. | My questions are:
  24. | (1)  If I GlobalAlloc in the DLL, and get a handle using one application,
  25. |      then another application accesses this handle, will I get the data from
  26. |      the first application UNDER WINDOWS NT?  I know that it works
  27. |     under Windows 3.1.
  28.  
  29.     John> No.  This won't work.
  30.  
  31.     John> However, I have just posted a dll which handles shared memory
  32.     John> under Windows NT.  Operations are ShrAlloc(), ShrLock(),
  33.     John> ShrUnlock(), ShrFree(), ShrName() to assign a name to a handle
  34.     John> and ShrGet() to get a handle based upon a name.
  35.  
  36.     John> I even make heroic efforts to force all addresses to be identical
  37.     John> across processes.
  38.  
  39.     John> This is available on Compuserve WIN32 porting from OS/2.
  40.  
  41.     John> Included in this kit is source code for the dll, test code,
  42.     John> and some discussions on implementation decisions.  
  43.  
  44.     John> I'll ask Alistair to place it on ftp.
  45.  
  46. There's something strange going on here.
  47.  
  48. I've got 2 Windows 3.1 applications that I'm porting to NT.
  49.  
  50. App1 does GlobalAlloc, GlobalLock, fills in the memory, GlobalUnlock,
  51. PostMessage the handle to app2.
  52.  
  53. App2 does GlobalLock, reads the memory, GlobalUnlock, GlobalFree.
  54.  
  55. Everything is fine and dandy.
  56.  
  57. Admittedly this isn't done in a DLL, but since DLLs (by default) run as
  58. if they were part of the app (accessing the app's data space, for
  59. instance) this shouldn't make any difference.
  60.  
  61. So what's going on?
  62. --
  63. Kevin Broadey <kbroadey@edscom.demon.co.uk>
  64. EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
  65. Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
  66. These opinions are mine: others available on request.
  67.