Call vb .dll from C++

Hello all;

A little background - I am what you might call an intermediate programmer in vb, and a beginner in C++ (currently taking a college course). I looked at forms for C++ and found them to be either really difficult, or really foreign - perhaps a combination of the two. At any rate, I want to create a program (it has to be in C++), but use a vb form as the GUI, since I am much more familiar with it.

I assume that you can create a form, compile it as a .dll, and use it withing C++. I'm a little confused, however, with how to handle the form events.

The problem is that, with C++, I am accustomed to using a cout statement as a blocking call while waiting for operator response. Without it, C++ code simply runs to the end of the code and closes. If using a vb form as a GUI, how do I deal with this What does the C++ code do while it is waiting for a button to be pressed on the form. How do I respond (in the C++) code to a button pressed.

Please be gentle with your answer - remember that I am very new at C++.

Thank you,

Steve Jackson




Answer this question

Call vb .dll from C++

  • CJ_1234

    have a look at this article.

    http://www.codeproject.com/dll/XDllPt2.asp

    it also has the index of step by step articles.

    Also a Google Search will help you alot


  • Heng-yi Liu

    It seems like you need to start with basic Windows (does not matter VB,C++, C#). Try couple of MFC samples for start , something like "HELLO Sample". MFC is very simular to VB in structure and functionality . You might discover it easier to do it just in C++, whatever you are trying to do. The reason I am suggesting it is that it is possible to use VB from C++, it requires COM knowledge or interop services of .Net, both are not easy.


  • ROBIverson

    OK, thanks - it is enough for me to know that it isn't the simplest way. Perhaps I will, indeed, play with the GUI builder in C++.

    SteveJ



  • Uwe Heinkel

    Sarath;

    Thank you for your reply. The link you provided, however, is the reverse of what I need. I want to call a vb.dll from C++. With respect to google, I did that before posting here - it didn't really help me alot :)

    Thanks



  • Call vb .dll from C++