?
Solved

VB & C++ communication

Posted on 1998-12-28
8
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 20 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month8 days, 13 hours left to enroll

764 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