ActiveX DLL Functions

ActiveX DLL Functions

Postby Jeff Barnes » Thu Aug 09, 2007 1:02 pm

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 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Antonio Linares » Thu Aug 09, 2007 1:24 pm

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: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Aug 09, 2007 1:27 pm

Image
regards, saludos

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

Postby Jeff Barnes » Thu Aug 09, 2007 6:21 pm

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 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Jeff Barnes » Thu Aug 09, 2007 6:31 pm

I guess step one is:

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



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

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Antonio Linares » Thu Aug 09, 2007 7:50 pm

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
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Jeff Barnes » Thu Aug 09, 2007 8:21 pm

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 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Antonio Linares » Thu Aug 09, 2007 8:43 pm

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
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Thu Aug 09, 2007 9:28 pm

Try this:

828B8942-5924-4BD3-963D-20786181A6A4


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Jeff Barnes » Thu Aug 09, 2007 10:49 pm

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 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Antonio Linares » Thu Aug 09, 2007 11:52 pm

Jeff,

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

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

Postby Jeff Barnes » Fri Aug 10, 2007 12:11 am

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

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby Antonio Linares » Fri Aug 10, 2007 12:31 am

Jeff,

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

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

Postby Jeff Barnes » Fri Aug 10, 2007 1:05 am

Antonio,

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

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Postby James Bott » Fri Aug 10, 2007 1:11 am

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests