-1

I have a c++ application that streams out data. I need to add a function in my C# application that listens for, and stores this data. I have some c++ knowledge, and some C# knowledge, but no networking experience. I am unable to use dll marshaling in this case.

What is a fairly simple, low latency way to send and receive this data? Should I be using Sockets/ports? or named pipes?

Thank you.

anti
  • 3,011
  • 7
  • 36
  • 86

1 Answers1

-1

Your query is pretty vague, but what I would do is create a library in one language and import it in another language. For example, you could create a new Project in visual studio called "Class Library". And then add the following code.

public static class Fncs
{
    public static void Temp()
    {
        MessageBox.Show("UgityBugityBoo");
    }
}

And then press F5 to build the library. Then create a C++ project and add the DLL file created by the previous project to "references". Then you can use subroutines and classes from this library like so.

#include <previousCsharplibrary>

int main()
{
    Fncs.Temp();
    return 0;
}
Sophie Coyne
  • 1,018
  • 7
  • 16