Thread: DLL's to pass data

  1. #1
    Registered User
    Join Date
    May 2007

    Question DLL's to pass data

    First - I'm not a C developer and know just enough to get in trouble. I can create a DLL project in MS .NET 2003 and I am somewhat familiar with _declspec(dllexport) and _declspec(dllimport) but am not a pro.

    Lets say I have 2 programs running and I want to create a DLL (or DLL's) that I can use to pass data back and forth bewteen the 2 programs. (Lets say both programs are written in C++ for now, but one program will be Labview in the future) Maybe I can make different DLL's for different data types.

    What would be a good way to be able to read/write int data (or an array of int's) from the DLL?

    Can someone give me a quick example of the code for the DLL ?

    Any help would be GREATLY appreciated

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Why does it have to be through a DLL? Is there a reason you haven't decided to open a pipe between the two programs? If you have a lot of data to read/write from one process to another, you should probably look into a different method of communication.

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    When a program loads a DLL, it loads it as it's own instance. So basicly your two programs will be using their own DLL (in a manner of speaking).

    EDIT: You might want to see into using atoms.
    Last edited by Queatrix; 05-10-2007 at 05:47 PM.

  4. #4
    train spotter
    Join Date
    Aug 2001
    near a computer
    Looked at MS Message Queues (MSMQ)?

    Can be transactional and would eliminate the need for dlls.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 03:45 AM
  2. Replies: 4
    Last Post: 06-14-2005, 05:45 AM
  3. [question]Analyzing data in a two-dimensional array
    By burbose in forum C Programming
    Replies: 2
    Last Post: 06-13-2005, 07:31 AM
  4. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 09:09 PM
  5. C diamonds and perls :)
    By Carlos in forum A Brief History of
    Replies: 7
    Last Post: 05-16-2003, 10:19 PM