Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

Calling ActiveX dll from c

Hi i posted a question earlier and this is basically what i need help with
I need to connect to a vb ActiveX.dll. I have 2 functions in this dll
1) Getsignature(lngAcc as long,lngAmt as long,strTrans as string)
2) FetchSignature(strAction as string,strResults as string)

I need to modify an existing c program so i can initiate a thread to activate this dll and it's first function getsignature.
now the way i understand this is that this thread will run under my C's process space therefore i do not have to worry about
marshaling the threads, is this correct ?

I do know i have to use the Iunknown interface
and the CoCreateInstance, Coinitialise and CoUnInitialise
then i need to call function 2 FetchSignatures()

does anyone have an idea on how to code this in C. My c is very rusty so as much explanation will be appreciated.
I only have the Visual C++ enviroment on the pc, but i do know that u can open a c/c++ source file and put straight c int there ??


thanx allot for your help


:)

Craig


ASKER CERTIFIED SOLUTION
Avatar of sharonk
sharonk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexVirochovsky
AlexVirochovsky

Try next:
http://ourworld.compuserve.com/homepages/John_Maddock/
The Ole Proxy Wizard is a tool to generate OCF/OWL based code
for handling OLE Automation servers and ActiveX Servers.
It reads a type library, and extracts all the information
it can: for example dual interfaces get C++ abstract class
definitions defined for them as well as OLE automation based
proxy classes. ProxyWizard also tries to find all types that
are marked as event sources and generates sample event
handling code for TOleWindow or TOleDialog based classes,
that you can cut and paste into your own code.
Examples of custom event handling are given in the demo
applications.

But after ProxyWiz maked code, you must change it to you needs.