C++.NET

Moderators: Lundin
Number of threads: 99
Number of posts: 163

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
C++ with VB.NET Posted by Pulsar79 on 7 May 2009 at 11:10 PM
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.
Report
Re: C++ with VB.NET Posted by Lundin on 7 May 2009 at 11:43 PM
None of those. To make a DLL in C and call it from VB works great.
Report
Re: C++ with VB.NET Posted by Pulsar79 on 8 May 2009 at 1:08 AM
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?
Report
Re: C++ with VB.NET Posted by Lundin on 8 May 2009 at 6:49 AM
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.
Report
Re: C++ with VB.NET Posted by Pulsar79 on 9 May 2009 at 10:06 AM
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?

Thanks!
Report
Re: C++ with VB.NET Posted by Lundin on 9 May 2009 at 12:41 PM
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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.