Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Gui with VB for C++ win32 console? 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
VBGui (Visitor) Dec 23, 2001
howdy,
I would like to know how to make a gui using VB. The main program would be in Win32 console C++.
Ex.
suppose I have a C++ program created using win32 console.
Just to make it easy to understand what I am getting at,
fisrt I make a program to ask using to enter like his name and C++ cout it to screen.
Now How can I make the interface using VB? like when
C++ cout<<&quot;Enter name: &quot;; I would like it to be a VB input box.

Any know if this can be done?

 
Thats something I wanted to try too. Its so eay to make a GUI in VB but C is better for the code work. I've searched and couldn't find an answer. The closest I got was to make dll in C and call them from VB.
 
Hi GuiVB and chiuchimu

The trick is not to create a Win32 console app.Choose instead MFC ActiveX ControlWizard project.Default through to the page 2 of 2 and check &quot;invisible at runtime&quot;.This creates an ocx. file that with do the hard code.

In the &quot;CMyOcxCtrl.cls&quot; class you declare and define your functions and in the &quot;DMyOcx.cls&quot; class You declare your interfaces, that is, function calls and return types available to the GUI.

Use the Build ocx. In the GUI go references -> browse to the MyOcx project ->debug -> MyOcx.tlb ok.

You will see in the object browser the ocx. and the interfaces

Jon
 
Once you have your object loaded in the object browser how do you use it? MYenigmaSELF:-9
myenigmaself@yahoo.com
&quot;If debugging is the process of removing bugs, then programming must be the process of putting them in.&quot; --Dykstra
 
Declare it where you normally declare variables
Public MyVar = MyObject
set it (such as it form_load)
Set MyVar = New MyObject
and release it when you're done with it
Set MyVar = Nothing

Jon

 
What's up?

How do I declare member variables that aren't c++ integral types (like arrays, for example) in CMyOcxCtrl.cls?
 
Hi,
Arrays are integral types in C++. To declare one such as
int MyVar[10];
In the classview tree right click the class select Add Member Variable you'll get a message box. In the top text box declare the variable type (int), in the bottom one, the variable itself MyVar[10];
Then choose the access Public,Protected or Private

Jon
 
What if I want to declare member variables of another c++ class that I wrote?
 
Hi Confused,

This thread's original intention was to show how to use a C++ OCX in a vb app. For an in-depth discussion on C++ variables you might want to try another forum. If I was to hazzard a guess to your latest question I would have to say

Inheritance

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top