ActiveX

Post Reply
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

ActiveX

Post by byron.hopp »

I eventually would like to utilize Word in an ActiveX container in Fivewin. I am trying to start by utilizing the Webexp.prg to learn (per Antonio post). I cannot get this to run. I also cannot find anything about TActiveX in the manuals under "A", or "T". Do I need a special library to be linked in to get this example to work?

Error I get:

Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = O Object
[ 2] = N 200

Stack Calls
===========
Called from: TActiveX.prg => TACTIVEX:NEW(0)
Called from: TActiveX.prg => CREATEACTIVEX(184)
Called from: TActiveX.prg => TACTIVEX:NEW(0)
Called from: webexp.prg => MAIN(10)

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Friend,

This is a sample with Activex class?

Code: Select all

#include "FiveWin.ch"

function Main()
   local oWnd, oActiveX
   local cEvents := ""

   DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

   oActiveX = TActiveX():New( oWnd, "Shell.Explorer.2" )

   oActiveX:Do( "ToolBar"   , "true" ) 
   oActiveX:Do( "StatusBar", "true" ) 
   oActiveX:Do( "MenuBar"  , .T. ) 
   oActiveX:Do( "Visible"     , .T. ) 

   oWnd:oClient = oActiveX // To fill the entire window surface

   oActiveX:Do( "Navigate", "http://www.google.com" )

   ACTIVATE WINDOW oWnd

return nil
And here the OLE class:

Code: Select all

#include "FiveWin.ch"

function Main()
   local oWnd, oIE
   local cEvents := ""

   DEFINE WINDOW oWnd TITLE "Internet Test"

   oIE:=TOleAuto():New( "InternetExplorer.Application" )

   oIE:ToolBar   := .T.
   oIE:StatusBar := .T.
   oIE:MenuBar   := .F.
   oIE:Visible   := .T.

   oWnd:oClient = oIE // To fill the entire window surface

   oIE:Navigate( "http://www.google.com" )

   oIE:End()

   ACTIVATE WINDOW oWnd

return nil
Try and report.
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Post by anserkk »

Hi,

What is the difference between TOle class and TActivex class. In the above given example both the classes are doin the same. Where to use what ?.

May be it is a very silly question. Would like to know the difference

Regards

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

Post by Enrico Maria Giordano »

anserkk wrote:Hi,

What is the difference between TOle class and TActivex class. In the above given example both the classes are doin the same. Where to use what ?.

May be it is a very silly question. Would like to know the difference

Regards

Anser
They are both based on OLE technology but ActiveX is a control working like any other controls.

EMG
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

ActiveX

Post by byron.hopp »

Neither one works, the standard ole (the second one) does manage to launch Internet Explorer, but the window title is "Google - Windows Internet Explorer" which I believe is not in the Windows Container planned for in the code. I have gotten OLE to work very well with Excel so I am famialiar with controlling another application. I like to make sure the application is within a window I have created by the application. Is there any special libs I need to utilize. Is the only problem the way I call the application in the TActiveX new method (the program ID)? The activeX seems to be dying there.

Thanks,
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Byron,

The problem comes from the libraries linking order. You have to link FWH libraries, before xHarbour ones.

> Called from: TActiveX.prg => TACTIVEX:NEW(0)

FWH does not include a TActiveX.prg, so that one is from xHarbour not from FWH. You need to use the FWH one.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply