Sending void pointer from c ++ exe to vb.net dll via named pipe

I have a C ++ project (exe). I want the vb.net dll to receive data sent from a C ++ project. I want to send void pointer from C ++ exe to vb.net dll. I have to send it over a named pipe. Can any body help how can I get the void pointer on the vb.net side and render it appropriately.

Thank you in advance

+3


source to share


1 answer


As already mentioned. if C ++ is not part of the same address space (same running process or "exe"), you will need to transfer data from one process to another. This is usually called Inter Process Communication (IPC) and can be done in many ways. There is a whole framework for this.

If your C ++ application is a .Net process, you can try uninstalling. The easiest way is to create an assembly that is split between the two processes and can communicate via a .net jumper over named pipes or TCP, or whichever you prefer. I've done this many times, and while it has its drawbacks, its workability.



If your C ++ application is not .Net, you are probably stuck creating some sort of protocol and marshaling data between two processes. Alternatively, if you are just trying to use a C ++ library in a .net application, you can try creating a C ++. Net assembly (which is what MS calls IJW). It's a little tricky to set up, but works pretty well. The advantage is that you can combine data as easily as you can call a function in your main application. The biggest drawback is that C ++ assemblies do not support "CPU any", so any application referencing your C ++ assembly must match its 32 or 63 bit assembly.

+1


source







All Articles