home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4771 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  1.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!psuvax1!ukma!hsdndev!xait!xait!ting
  2. From: ting@XAIT.Xerox.COM (Hungtau Ting)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: HELP!! C++ static data member in DLLs
  5. Keywords: C++, DLL, VB
  6. Message-ID: <1993Jan8.224822.20266@XAIT.Xerox.COM>
  7. Date: 8 Jan 93 22:48:22 GMT
  8. Sender: news@XAIT.Xerox.COM (The Time Waster)
  9. Reply-To: ting@xait.xerox.com
  10. Organization: Xerox Advanced Information Technology
  11. Lines: 34
  12.  
  13. Hi,
  14.  
  15. The C++ static data in DLLs will not work properly as stated in Borland C++
  16. Programmer's Guid, page 336:
  17.  
  18.     Through a DLL's functions, all applications using the DLL have
  19.     access to that DLL's global data.  A particular function will use
  20.     the same data, regardless of the application that called it. If you
  21.     want a DLL's global data to be protected for use by a single
  22.     application, you would need to write that protection yourself.
  23.                                        ------------------------------
  24.  
  25.     The DLL itself does not have a mechanism for making global data
  26.     available to a single application.  If you need data to be private
  27.     for a given caller of DLL, you will need to dynamically allocate
  28.                                                  -----------------------
  29.     the data and manage the access to that data manually.  Static data
  30.     ---------------------------------------------------
  31.     is global to all callers of a DLL.
  32.  
  33. Since our UI is built with Visual Basic (v2.0) which only works with DLL
  34. and was ported from SUN UNIX/C++ (a lot of static data), we have to "write
  35. that protection ourselves".
  36.  
  37. Someone out there in the netland should have delt with this problem already.
  38. So, If you're the someone, would you please email me any info that might help?
  39.  
  40. Thanks,
  41.  
  42. Hungtau Ting
  43. Software Engneer
  44. XAIT
  45.  
  46. ting@xait.xerox.com
  47.