ActiveX

ActiveX

Postby byron.hopp » Sun Nov 02, 2008 1: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Postby Rochinha » Sun Nov 02, 2008 7:32 am

Friend,

This is a sample with Activex class?

Code: Select all  Expand view
#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  Expand view
#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.
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby anserkk » Sun Nov 02, 2008 9: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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

ActiveX

Postby byron.hopp » Sun Nov 02, 2008 3: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
byron.hopp
 
Posts: 382
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA

Postby Antonio Linares » Sun Nov 02, 2008 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 93 guests