Click to See Complete Forum and Search --> : Calling functions in VB app


William Dicks
June 16th, 1999, 12:37 PM
We have a system developed in VC++ 6.0, but need a DLL or something else
from another company to make use of their functionality.

Their system is a combination of Visual Basic with a dll written in C.
The unfortunate part is that a lot of the functionality that they would like to
have in the dll is currently residing in the VB code. A lot of what the VB code
does for them involves database lookups of rates and pricing information.
Doing the database access in C++ is much more difficult for them, so they
haven't moved that functionality there yet. If we tell them that we absolutely
must have a dll and a dll only, they're then facing significant rewriting of the
system and they're not sure of how long such an effort will take. So, my
question for you is whether our system could call their executable via COM
instead of a dll.

I haven't worked much with COM, so I do not know what kind of solution I
need here. I do however realize that they can use COM to register functions
from the VB application that my app can call via COM.

Am I right in assuming this?

***
"Delaying decisions" is too often a euphemism for
"avoiding thinking."
- Bjarne Stroustrup

Wayne Fuller
June 16th, 1999, 02:51 PM
Yes you are right to go through COM. If you are new at it, then I suggest go
the #import route.
To see the generated files, do this at the top of some file in your project.

#import "Path to dll\some.dll" no_namespace

Hopefully you will not get any errors, those can be very cryptic. There should be
some TLH file in your DEBUG or RELEASE dir ( depending on what environment you
are currently working in ). This will show the wrappers for the COM interfaces and
functions. After you get to this point send me an e-mail, and I can help you with the
rest of the way.

Wayne

wphfuller@mindspring.com

William Dicks
June 16th, 1999, 03:05 PM
Are you suggesting that I #import the other company's VB Application .exe? That surely can only be done if they have made their application also a COM server with the proper registration of functions, etc?

William Dicks


***
"Delaying decisions" is too often a euphemism for
"avoiding thinking."
- Bjarne Stroustrup

Wayne Fuller
June 16th, 1999, 03:13 PM
I apoligize, I thought the VB was the DLL. What they can do is to use the code stick it in a VB 'class' and
recompile it as an Active X Dll which then you could use through COM.

Wayne