Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combining VB and C/C++ programming?

Tags:

c

vb.net

dll

From what I've read there seem to be multiple ways to combine 2 separate programming languages such that they interface. For my needs, I really would like to make a gui in VB (Microsoft Visual Studio 2008 - Windows 7 - 64 bit) and then do the back end code in c (I already have a c program written, I want to make a gui so that general users can use the thing).

So I don't really know which way to go.

I've been told you can use pipes between the two languages, or write a c .dll and then export it into the vb application, and the list runs on. I've been trying to find a guide on the .dll way but all I really find is what a dll is, not how to actually implement the thing. (There are pretty good sites on how to use vb.net w/ c++, but I have no clue how to even get to making a .dll in vb)

Could someone point me in the direction of a good guide? I'd love if there was some helpful site that just showed a simple calculator or something called from one program into another program.

like image 709
Zach S Avatar asked Dec 28 '25 10:12

Zach S


1 Answers

Creating a class library in VB.net is not much different from any other Visual Studio library. You can see a general know how here: http://www.csunit.org/tutorials/tutorial6/#createclasslibrary

Once you have your gui library, you can easily create a vb.net application that will show your gui. If you want a C backend, you won't be able to use COM interfaces, so you'll have to use pipes manually to do IPC. If you do a C# or C++ backend (which you might want to do), then you can create a COM+ interface in those languages that the VB.NET frontend can interact with to send messages.

http://www.codeproject.com/Articles/4732/COM-Interface-Basics

like image 182
Magn3s1um Avatar answered Dec 31 '25 00:12

Magn3s1um



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!