Article View: comp.os.ms-windows.programmer.misc
Article #2628HELP!! C++ static data member in DLLs
From: Hungtau Ting
Date: Fri, 08 Jan 1993 22:48
Date: Fri, 08 Jan 1993 22:48
34 lines
1862 bytes
1862 bytes
Hi,
The C++ static data in DLLs will not work properly as stated in Borland C++
Programmer's Guid, page 336:
Through a DLL's functions, all applications using the DLL have
access to that DLL's global data. A particular function will use
the same data, regardless of the application that called it. If you
want a DLL's global data to be protected for use by a single
application, you would need to write that protection yourself.
------------------------------
The DLL itself does not have a mechanism for making global data
available to a single application. If you need data to be private
for a given caller of DLL, you will need to dynamically allocate
-----------------------
the data and manage the access to that data manually. Static data
---------------------------------------------------
is global to all callers of a DLL.
Since our UI is built with Visual Basic (v2.0) which only works with DLL
and was ported from SUN UNIX/C++ (a lot of static data), we have to "write
that protection ourselves".
Someone out there in the netland should have delt with this problem already.
So, If you're the someone, would you please email me any info that might help?
Thanks,
Hungtau Ting
Software Engneer
XAIT
ting@xait.xerox.com
Technical Details
Message-ID:
<1993Jan8.224822.20266@XAIT.Xerox.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!psuvax1!ukma!hsdndev!xait!xait!tingShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!uwm.edu!psuvax1!ukma!hsdndev!xait!xait!ting From: ting@XAIT.Xerox.COM (Hungtau Ting) Newsgroups: comp.os.ms-windows.programmer.misc Subject: HELP!! C++ static data member in DLLs Keywords: C++, DLL, VB Message-ID: <1993Jan8.224822.20266@XAIT.Xerox.COM> Date: 8 Jan 93 22:48:22 GMT Sender: news@XAIT.Xerox.COM (The Time Waster) Reply-To: ting@xait.xerox.com Organization: Xerox Advanced Information Technology Lines: 34