ActiveX DLL Functions

User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

ActiveX DLL Functions

Post 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,
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jeff,

Please make a search for TActiveX in these forums.

There are many examples
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post 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?
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

I guess step one is:

hPOX := LoadLibrary("\DLL\MyFile.DLL")



But how do I setup the oActiveX object?
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post 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.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post 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,
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jeff,

Do you get an error.log file ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

Sorry, no error.log file is generated.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Jeff,

Have you tried that ActiveX with Visual Basic ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jeff Barnes
Posts: 912
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada
Contact:

Post by Jeff Barnes »

Antonio,

I have no way to test with Vb.
Thanks,
Jeff Barnes

(FWH 12.01, xHarbour 1.2.1, Bcc582)
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post 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
Post Reply