C++ with VB.NET

Good boys.

Look, I realize a program of powerful enough management. It realizes mathematical calculations and uses many geometry. The topic is that I have the interface of the program in Visual Basic .NET but for the algorithms I want to use C ++ or C pure. Then I want to communicate the program in Visual with these algorithms in C that will return to him results of calculations of triangulation, volumes, profiles of terrains, etc., some rapid calculations, others can be late 10 minutes or more.

Some calculations I need to load a lot of information before realizing them, and then to do calls asking for the same calculation, for what I need that these algorithms stay with certain resident variables in memory, for what P/Invoke's use does not convince me.

I have several options to communicate, to see if you recommend to me the best:

* By means of a local socket, and to use a protocol of commands
* To do the processes in C ++ as services
* Communication between processes (MPI?)
* P/Invoke, though I believe that this does not serve me completely
* C ++/CLI
* Does someone happen to you more?

Thank you for your attention.


  • None of those. To make a DLL in C and call it from VB works great.
  • Yes... P/Invoke, you say. But... this goes well when you have a function and pass the parameters, but if you have to pass parameters that they are large (list of 500.000 points, etc.), this consumes time, and i need that the parameters stay in the memory of the program in C in the first call. Can i use pointers?
  • I see no reason why you would pass that by value no matter language. You should be able to pass the values to the DLL through "ByRef", if you even need to allocate them in VB in the first place.

    If VB is only there for GUI stuff, then you really don't need to store anything at all in VB. Allocate everything in the DLL and let VB call various functions.
  • Yes, I consider that you say is a good option. I believe that I will use P/Invoke for to do calls. Do you know any document (web, pdf, etc) where I can learn P/Invoke well?

  • I don't even know what that is. Simply use the Win API functions. And VB has a simple syntax for declaring functions located in a DLL, although that syntax may vary depending on VB version (as that whole frigging language does). I avoid VB entirely myself.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion