FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ActiveX
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
ActiveX
Posted: Sun Nov 02, 2008 01:01 AM

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
Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
ActiveX
Posted: Sun Nov 02, 2008 07:32 AM
Friend,

This is a sample with Activex class?

#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:
#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.
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
ActiveX
Posted: Sun Nov 02, 2008 09:23 AM

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

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
ActiveX
Posted: Sun Nov 02, 2008 11:52 AM
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
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
ActiveX
Posted: Sun Nov 02, 2008 03:59 PM

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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
ActiveX
Posted: Sun Nov 02, 2008 07:22 PM

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

Continue the discussion