Page 1 of 2
ActiveX DLL Functions
Posted: Thu Aug 09, 2007 1:02 pm
by Jeff Barnes
Hi Everybody,
I have an ActiveX DLL that I need to call functions from.
I have not tried any ActiveX before and do not know where to start.
Can someone give me some pointers as to how to call functions inside an ActiveX DLL.
Thanks,
Posted: Thu Aug 09, 2007 1:24 pm
by Antonio Linares
Jeff,
Please make a search for TActiveX in these forums.
There are many examples
Posted: Thu Aug 09, 2007 1:27 pm
by Antonio Linares
Posted: Thu Aug 09, 2007 6:21 pm
by Jeff Barnes
Antonio,
I've been looking at the different posts but I can not see how I tell my program that I want to use MyFile.DLL.
It looks like once I get that figured out I would be using commands like:
oActiveX:DO("MyFunction")
Is that correct?
Posted: Thu Aug 09, 2007 6:31 pm
by Jeff Barnes
I guess step one is:
hPOX := LoadLibrary("\DLL\MyFile.DLL")
But how do I setup the oActiveX object?
Posted: Thu Aug 09, 2007 7:50 pm
by Antonio Linares
Jeff,
The first step is to know the PROGID (is a string) of the ActiveX that you are going to use.
i.e. for Microsoft Excell the progid is "OWC11.Spreadsheet"
Whats the activex that you are going to use ?
Posted: Thu Aug 09, 2007 8:21 pm
by Jeff Barnes
it is a 3rd party ActiveX that is used to control a medical device.
Any idea on how I would find the PROGID.
I looked at the DLL file with OleView (via the ITypeLib Viewer) but I can not see anything that looks like the ID.
Posted: Thu Aug 09, 2007 8:43 pm
by Antonio Linares
Jeff,
Don't you have access to that ActiveX docs ?
You can also use its GUID instead of its PROGID (
http://en.wikipedia.org/wiki/Globally_Unique_Identifier ) which usually looks as a long sequence of numbers separated by "-" and between "{" and "}"
Have you tried to instantiate the ActiveX from VB and review its properties ?
Posted: Thu Aug 09, 2007 9:28 pm
by Enrico Maria Giordano
Try this:
828B8942-5924-4BD3-963D-20786181A6A4
EMG
Posted: Thu Aug 09, 2007 10:49 pm
by Jeff Barnes
When I try to do:
oPulseOX = TActiveX():New( oMainWnd, "{828B8942-5924-4BD3-963D-20786181A6A4}" )
I get an empty white box in the upper left corner and the windows error:
EzSat.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
Is there something I need to link into my app?
Thanks,
Posted: Thu Aug 09, 2007 11:52 pm
by Antonio Linares
Jeff,
Do you get an error.log file ?
Posted: Fri Aug 10, 2007 12:11 am
by Jeff Barnes
Sorry, no error.log file is generated.
Posted: Fri Aug 10, 2007 12:31 am
by Antonio Linares
Jeff,
Have you tried that ActiveX with Visual Basic ?
Posted: Fri Aug 10, 2007 1:05 am
by Jeff Barnes
Antonio,
I have no way to test with Vb.
Posted: Fri Aug 10, 2007 1:11 am
by James Bott
Jeff,
I am no ActiveX expert, but if I remember correctly ActiveX components have to be registered in the registry. You might do a Google on it.
James