Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB & C++ communication

Posted on 1998-12-28
8
Medium Priority
?
237 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

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.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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

636 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