Click to See Complete Forum and Search --> : C++ and VB


Sigal Laniado
January 12th, 2000, 08:21 AM
I want to build an application in VC++ that will "talk" with an application in VB
What is the best way to do it?
Is there any place i can read about it?

Lothar Haensler
January 12th, 2000, 08:58 AM
IMHO the "best" way is via COM.
make your VB "app" an ActiveX DLL (or exe), import the Typelibrary of the COM component into your VC project via the "#import" directive in VC 6 and voila call the properties and methods "the COM way".

For further reading, refer to MSDN, particularly the knowledgebase.

CMichael
January 12th, 2000, 09:13 AM
If you want to have to apps running at the same time and you want to speak at each other, try to send Windows-Messages. There's a way to handle WM-Messages in VB.

Otherwise try to build in VC an ActiveX-Control (.OCX). It's VERY easy to use it with VB.

Another way is to build a VC DLL (it's no real app, but it can show dialogs etc.). Use _stdcall function() to export functions because VB can only import functions with this convention.

'hope it'll help you


'CMichael