home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / win32 / 814 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.9 KB  |  75 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: Martin_Schloeter@eurologic.fido.de's message of Wed,  2 Sep 92 10:06:59 +0200
  6. Message-ID: <KEVIN.92Sep3230205@runningbear.edscom.demon.co.uk>
  7. Sender: kevin@edscom.demon.co.uk (Kevin Broadey)
  8. Organization: EDS-Scicon, Milton Keynes, UK
  9. References: <199bb4a9@p3.f67.n245.z2.fidonet.org>
  10. Date: Thu, 3 Sep 1992 23:02:05 GMT
  11. Lines: 62
  12.  
  13. >>>>> In article <199bb4a9@p3.f67.n245.z2.fidonet.org>, "MS" ==
  14. >>>>> Martin_Schloeter@eurologic.fido.de (Martin Schloeter) writes:
  15.  
  16. >>>>> "RB" == Robert Baruch
  17.  
  18.     RB> After reading countless paragraphs on how Windows supports only
  19.     RB> a few means of data transfer between applications, I have come
  20.     RB> to the conclusion that if I didn't want to use DDE, I could use
  21.     RB> a DLL, and GlobalAlloc memory which could then be shared between
  22.     RB> all the applications using that DLL.
  23.  
  24.     RB> My questions are:
  25.  
  26.     RB> (1) If I GlobalAlloc in the DLL, and get a handle using one
  27.     RB> application, then another application accesses this handle, will
  28.     RB> I get the data from the first application UNDER WINDOWS NT?  I
  29.     RB> know that it works under Windows 3.1.
  30.  
  31.     MS> Under 3.1 it works only with memory with the attribute
  32.     MS> GMEM_DDESHARE!  Regarding the existing informations it will
  33.     MS> definitly _not_ work with NT. The API calls DDEPostMessage and
  34.     MS> similiar do some magic, which allows to transfer data between NT
  35.     MS> apps. Simple DDEShare-memory will not work.
  36.  
  37. It does work.  If you GlobalAlloc(GHND | GMEM_DDESHARE, size) in one
  38. application, you can PostMessage the handle to another application,
  39. GlobalLock it there and read whatever the first application wrote there.
  40. The same is true of memory GlobalAlloc'ed in a DLL.
  41.  
  42. I've tried it so I know it works.
  43.  
  44.     RB> (2) Are global variables declared in a DLL shareable between
  45.     RB> applications under Windows NT?  Again, I know it works under 3.1
  46.  
  47.     MS> No.
  48.  
  49. Again, this can be done. You need to put:-
  50.  
  51.     SECTIONS
  52.     .data        READ WRITE SHARED
  53.     .bss        READ WRITE SHARED
  54.  
  55. in the .DEF file for your DLL.  Again, I'm using this at the moment.
  56.  
  57.     RB> (3) If a DLL enters a message loop on behalf of an application,
  58.     RB> will that message loop receive messages posted to the
  59.     RB> application properly under NT?  Once again, it works under 3.1.
  60.  
  61.     MS> Don't know, have to test it.
  62.  
  63. I can't help either :-)
  64.  
  65. --
  66. Kevin Broadey <kbroadey@edscom.demon.co.uk>
  67. EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
  68. Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
  69. These opinions are mine: others available on request.
  70. --
  71. Kevin Broadey <kbroadey@edscom.demon.co.uk>
  72. EDS-Scicon, Wavendon Tower, Wavendon, Milton Keynes, MK17 8LX, England.
  73. Phone: +44 908 284198 (direct) or +44 908 585858 ext 4198
  74. These opinions are mine: others available on request.
  75.