I have a c++ project (exe). I want my vb.net dll to get the data sent from c++ project. I want to send a void pointer from c++ exe to the vb.net dll. I have to send it via a named pipe. Can any body help how can i get the void pointer on the vb.net side and cast it accordingly.
Thanks in advance
As mentioned. unless the C++ is part of the same address space (same running process or “exe”) you will need to transfer the data from one process to the other. This is typically called Inter Process Communication (IPC) and can be accomplished many ways. There are entire frameworks for this kind of thing.
If your C++ application is a .Net process you could try remoting. The easiest way is to create an assembly that is shared between the two processes and can communicate via .net remoting over named pipes or TCP or whatever you prefer. Ive done this many times and while it has its downside, its workable.
If your C++ application is not .Net you are probably stuck creating some sort of protocol and marshal the data between the two processes. Alternatively if you just trying to use a C++ library in a .net application you could try creating a C++ .Net assembly (what MS calls IJW). Its a bit tricky to set up, but works rather well. The benefit there is you can marshal the data across as easily as calling a function in your main application. The biggest downside is that C++ assemblies do not support “CPU any” so any application that references your C++ assembly must match its 32 or 63 bit build.