3

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.

2
  • 1
    As far as I understand you, there is no need to create a DLL from VB. Put your C-coded backend logic in a DLL and create an executable in VB. Let the latter call the DLL based C functions from the VB exe. The key word for googling how to call DLL based C functions from VB is "Mixed Language Programming". Or just follow this guide as a start: support.microsoft.com/kb/106553/en-us Commented Jun 6, 2013 at 14:36
  • Thanks very much! Yep, I figured out how to make a c dll, so my plan as of now is to call it from my VB executable just as you said--just hoping it works since my c code is pretty complicated Commented Jun 11, 2013 at 13:21

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.