Solved

VB & C++ communication

Posted on 1998-12-28
8
210 Views
Last Modified: 2010-05-03
hi,
I would like to enquire abt the following:
1) My GUI is in VB
2) My callback functions are in C++

Is DLL the only way to communicate between the 2, i.e. i compile the C++ functions as a dll?
Or can i compile the C++ and use the object files *.o for compilation with the VB application?
Or are there any better ways?

Please advise.
Thanks.
0
Comment
Question by:andreat
  • 5
  • 2
8 Comments
 
LVL 4

Expert Comment

by:idcanada
ID: 1452820
DLL is NOT the only way but a very good way, therefore used by most programmers.

In your case, for max preformance,
convert your C++ callbacks to VB. If you do not wish to do this,
have the GUI constructed with C++.

1 Language should be your focus here.



0
 

Author Comment

by:andreat
ID: 1452821
hi,
due to the complexity of the project and the little time left,
i have to stick to using VB for GUI and VC++ for callbacks.

as such, would appreciate it if u can recommend other methods
where I can satisfy the above requirements and the program can work. can i compile of C++'s object files instead of dll?

andrea
0
 

Author Comment

by:andreat
ID: 1452822
hi,
due to the complexity of the project and the little time left,
i have to stick to using VB for GUI and VC++ for callbacks.

as such, would appreciate it if u can recommend other methods
where I can satisfy the above requirements and the program can work. can i compile of C++'s object files instead of dll?


0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 

Author Comment

by:andreat
ID: 1452823
sorry but i can't use your advice due to my comment above.
0
 

Accepted Solution

by:
Billaban earned 10 total points
ID: 1452824
If U can't change what is done, i.e.,  your stuck with VB GUI and VC plumbing.  U should be using COM.  Callbacks are COM Connection points.  In a nutshell, U make the C++ a COM server DLL and set a reference to it in your VB app.  Instantiate the server object and establish the connection point for the functional equivalent to a callback.  If U don't know anything about COM U better learn it if U want to survive writing code that traverses language boundaries.  I'm guessing U won't like this answer, since it is not a magical solution, but so be it.  With experience in ATL U could write the server in a few hours, but the first time around is pretty painful.

HTH
0
 

Author Comment

by:andreat
ID: 1452825
thanks for ur advice, though u sound as if I've offended u in some way or another.
0
 

Expert Comment

by:Billaban
ID: 1452826
No not at all. I simply perceived frustration in your query and presumed a response burdening U with a new learning curve would not be what U wanted to here.  The gospel documents of COM and COM/VB  are Dale Rogerson's  Inside COM,  Dan Appleman's COM/ActiveX book, and basic COM tutorial would be Don Box's Essential COM.  COM is not the easiest thing to learn... buy some books and digest them.

HTH
0
 

Author Comment

by:andreat
ID: 1452827
hi,
i guess my frustrations showed in my msg. time is running out on me :)
irregardless, thanks for your help.

andrea
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bit defender blocks good applications 2 94
using web browser with BING 40 121
Passing a Text Box name to a Sub 6 96
MsgBox 4 61
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question