Thread: How can i Send a string from C application to C# Application?

  1. #1
    Registered User smahdi1991's Avatar
    Join Date
    Nov 2009
    Posts
    32

    How can i Send a string from C application to C# Application?

    i developed 2programm that the first one is in C and the second one is in c#.and now i have to send some string text from c to c#.how can i do that in c ?

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    you asked almost the exact same question in the C# forum several days ago. has your problem changed so much in that time that my suggestion on that thread will not be satisfactory?
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  3. #3
    Registered User smahdi1991's Avatar
    Join Date
    Nov 2009
    Posts
    32
    thank you for your answer(it was too general for me because i'm a beginner in c) in that thread ,i cant use "a socket or rewrite the udp socket code in c#".it must be in c.and because i dont have much time to solve this problem then i saw there is no other answer ,and i decided to say my question in c board to get a better answer .
    Last edited by smahdi1991; 04-02-2014 at 12:05 AM.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    why can you not use a socket? you've already written one for the UDP communication. do you have access to the source code for both programs? if so, then it should be easy. sockets are insanely easy in C#/.Net.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  5. #5
    Registered User smahdi1991's Avatar
    Join Date
    Nov 2009
    Posts
    32
    my project is a sniffer.because the project make me to do this .if if there is no way to do an ipc between c and c# for sending captured filed from c to c# then i can use another method.

  6. #6
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    if you're running on windows, you can use a named pipe, or on any platform you can output to a file and have the C# program tail that file.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  7. #7
    Registered User smahdi1991's Avatar
    Join Date
    Nov 2009
    Posts
    32
    can you please tell a simple example for using in c and readit from c#?

  8. #8
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    File reading and writing is one of the first things they teach in any language. This site has a pretty good tutorial on file input and output.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  9. #9
    Registered User smahdi1991's Avatar
    Join Date
    Nov 2009
    Posts
    32
    thank you elkvis ,but i mean an example about named pipe.
    but thanks alot to you to help me and say there is something like named pipe in windows to solve my problem
    i found a realy good example hereit is: Inter-Process Communication between C# and C++ using named pipes - CodeProject
    .my problem almost solved.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 05-18-2012, 04:20 AM
  2. Replies: 0
    Last Post: 12-03-2011, 05:41 AM
  3. Replies: 1
    Last Post: 07-03-2010, 01:18 PM
  4. Replies: 2
    Last Post: 05-31-2006, 06:57 PM
  5. A send mail application with source code
    By Rizwan Rafique in forum Windows Programming
    Replies: 8
    Last Post: 01-11-2002, 10:22 AM