global variables accessed through multiple DLL class instance.

Discussion in 'C Programming' started by superseed@gmail.com, Sep 14, 2006.

  1. Guest

    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 ?
     
    , Sep 14, 2006
    #1
    1. Advertising

  2. CBFalconer Guest

    wrote:
    >
    > 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.

    --
    "I have a creative mind. You (singular) are eccentric.
    He is insane. We are losing sight of reality.
    You (plural) are smoking crack. They are certifiable."
    Declension of verbs, per Lewin Edwards



    --
    Posted via a free Usenet account from http://www.teranews.com
     
    CBFalconer, Sep 14, 2006
    #2
    1. Advertising

  3. jacob navia Guest

    wrote:
    > 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
     
    jacob navia, Sep 14, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mohammad Ali via DotNetMonster.com

    "Deleted row information cannot be accessed through the row." WHY!!

    Mohammad Ali via DotNetMonster.com, Apr 16, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    8,259
    Mohammad Ali via DotNetMonster.com
    Apr 16, 2005
  2. Replies:
    10
    Views:
    35,899
    jporter892
    Jun 6, 2011
  3. Replies:
    2
    Views:
    1,060
    Marek Vondrak
    Feb 11, 2006
  4. Sean Peterson
    Replies:
    2
    Views:
    797
  5. michael
    Replies:
    3
    Views:
    161
    Chris McMahon
    Oct 24, 2006
Loading...

Share This Page