Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. shared dll instance

shared dll instance

Scheduled Pinned Locked Moved C / C++ / MFC
hardwarehelptutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    misha_grewal
    wrote on last edited by
    #1

    Hi all, I have to create a win 32 dll which is loaded by two different processes. MSDN tells me that the dll is mapped to the process space of the calling exe and so there would be two instances of the dll running. The problem is that the dll which I have to create keeps doing some processing on a hardware board. Does it mean that both instances of my dll will keep on doing these operations parallely on the board? If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it. Any pointers in this direction and how to create a single shared instance of dll will be very helpful.

    T M 2 Replies Last reply
    0
    • M misha_grewal

      Hi all, I have to create a win 32 dll which is loaded by two different processes. MSDN tells me that the dll is mapped to the process space of the calling exe and so there would be two instances of the dll running. The problem is that the dll which I have to create keeps doing some processing on a hardware board. Does it mean that both instances of my dll will keep on doing these operations parallely on the board? If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it. Any pointers in this direction and how to create a single shared instance of dll will be very helpful.

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      misha_grewal wrote:

      If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it.

      you have to look for Synchronization classes here :- http://www.codeproject.com/threads/Synchronization.asp[^] http://www.codeproject.com/threads/semaphores.asp[^]

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      cheers, Alok Gupta VC Forum Q&A :- I/ IV

      1 Reply Last reply
      0
      • M misha_grewal

        Hi all, I have to create a win 32 dll which is loaded by two different processes. MSDN tells me that the dll is mapped to the process space of the calling exe and so there would be two instances of the dll running. The problem is that the dll which I have to create keeps doing some processing on a hardware board. Does it mean that both instances of my dll will keep on doing these operations parallely on the board? If this is the case then I need to make sure only one instance of the dll runs on the system, no matter how many processes load it. Any pointers in this direction and how to create a single shared instance of dll will be very helpful.

        M Offline
        M Offline
        misha_grewal
        wrote on last edited by
        #3

        We see the very common MFC as shared dll option in our projects. Does this option mean than only one instance of the MFC dll would be running on the system? What happens behind when create a MFC shared dll?Can I use the same technique to create a shared dll? Thanks in advance. Your responses are truly appreciated..

        T 1 Reply Last reply
        0
        • M misha_grewal

          We see the very common MFC as shared dll option in our projects. Does this option mean than only one instance of the MFC dll would be running on the system? What happens behind when create a MFC shared dll?Can I use the same technique to create a shared dll? Thanks in advance. Your responses are truly appreciated..

          T Offline
          T Offline
          ThatsAlok
          wrote on last edited by
          #4

          misha_grewal wrote:

          Does this option mean than only one instance of the MFC dll would be running on the system? What happens behind when create a MFC shared dll

          Yes there be only one Instance loaded in memory, and every function has it address, using which we can make the call to the function!.

          misha_grewal wrote:

          What happens behind when create a MFC shared dll

          there is lot of difference between shared MFC DLL and Dll you are creating... actually your problem is syncronization not sharing... actually here Shared mean that Application will use MFC dll previously loaded OS.. and BTW I believe MFC dll itself use Syncronization technique like Mutex,events etc

          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          cheers, Alok Gupta VC Forum Q&A :- I/ IV

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups