global variables accessed through multiple DLL class instance.

S

superseed

Hi, my problem is quite complexe to describe but here is a try :

I have a C++ library exporting a class which is wrapped using a C++
..Net Wrapper to be used in a C# software.

In the C++ library I have a file which contains C functions in which
there are global variable and pointers (it's not my code) and the C++
class access the C functions for some processing.

My C# application is multithreaded and I instanciate two classes
exported from the DLL which can be used concurrently.

My question is : Sometime it crashes and I suspect that the problem is
that the C global variables are unique even if I instanciate two
classes. Is that true ?
 
C

CBFalconer

Hi, my problem is quite complexe to describe but here is a try :

I have a C++ library exporting a class which is wrapped using a
C++ .Net Wrapper to be used in a C# software.

And is thoroughly off-topic here. We deal with C, not C++. DLLs
are specific to Microsoft, so are off topic both here and on
comp.lang.c++. C# is neither fish nor fowl, and any discussion
probably belongs on some newsgroup with Microsoft in its name.
 
J

jacob navia

Hi, my problem is quite complexe to describe but here is a try :

I have a C++ library exporting a class which is wrapped using a C++
.Net Wrapper to be used in a C# software.

In the C++ library I have a file which contains C functions in which
there are global variable and pointers (it's not my code) and the C++
class access the C functions for some processing.

My C# application is multithreaded and I instanciate two classes
exported from the DLL which can be used concurrently.

My question is : Sometime it crashes and I suspect that the problem is
that the C global variables are unique even if I instanciate two
classes. Is that true ?

Yes, if the dlls have the DATA SHARED feature. If the dlls were compiled
with that flag, data will be shared in all instances of the dll
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top