FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Problemas en 8.06 con Activex
Posts: 3
Joined: Wed Jul 23, 2008 07:02 PM
I Have is Problem!
Posted: Thu Jul 24, 2008 11:32 AM

Hello A.Linares.

I Working with ADVPL Microsiga. But, i compile the TActiveX class.

ERROR in METHOD :

METHOD SetProp( cPropName, uParam1 ) INLINE ;
--> OleSetProperty( ActXPdisp( ::hActiveX ), cPropName, uParam1 )

I Have class TActiveX complet, but, error continue compilation.

Very Thanks.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problemas en 8.06 con Activex
Posted: Thu Jul 24, 2008 11:49 AM

Jose,

What FWH and Harbour/xharbour version are you using ?

Whats the exact error that you get ? Please copy it here

>
METHOD SetProp( cPropName, uParam1 ) INLINE ;
--> OleSetProperty( ActXPdisp( ::hActiveX ), cPropName, uParam1 )
>

The above "-->" should not be there in the code

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3
Joined: Wed Jul 23, 2008 07:02 PM
Problemas en 8.06 con Activex
Posted: Thu Jul 24, 2008 11:55 AM
Hello A.Linares, the source is :



// FiveWin ActiveX support (32 bits only)

#include "FiveWin.ch"

#ifndef __XPP__
   #define  HKEY_CLASSES_ROOT       2147483648
#else
   #define  HKEY_CLASSES_ROOT       1
#endif

//----------------------------------------------------------------------------//

CLASS TActiveX FROM TControl

   CLASSDATA lRegistered AS LOGICAL

   DATA   hActiveX
   DATA   cProgID
   DATA   cString
   DATA   aProperties, aMethods, aEvents
   DATA   bOnEvent

   METHOD New( oWnd, cProgID, nRow, nCol, nWidth, nHeight ) CONSTRUCTOR

   METHOD ReDefine( nId, oWnd, cProgID ) CONSTRUCTOR

   METHOD Do( cMethodName, uParam1, uParam2, uParam3 )

   METHOD Display() INLINE ::BeginPaint(), ::Paint(), ::EndPaint(), 0

   METHOD EraseBkGnd( hDC ) INLINE 1

   METHOD GetProp( cPropName ) INLINE ;
             ActXGetProperty( ActXPdisp( ::hActiveX ), cPropName )

   METHOD Initiate( hDlg )
   
   METHOD OnEvent( nEvent, aParams )

   METHOD ReadTypes()

   METHOD ReSize( nFlags, nWidth, nHeight ) INLINE ;
             ActXSetLocation( ::hActiveX, 0, 0, nWidth, nHeight )

   METHOD SetProp( cPropName, uParam1 ) INLINE ;
             ActXSetProperty( ActXPdisp( ::hActiveX ), cPropName, uParam1 )

ENDCLASS

//----------------------------------------------------------------------------//

METHOD New( oWnd, cProgID, nRow, nCol, nWidth, nHeight ) CLASS TActiveX

   DEFAULT oWnd := GetWndDefault(), nRow := 0, nCol := 0, nWidth := 200,;
           nHeight := 200

   ::nTop    = nRow
   ::nLeft   = nCol
   ::nBottom = nRow + nHeight
   ::nRight  = nCol + nWidth
   ::oWnd    = oWnd
   ::nId     = ::GetNewId()
   ::nStyle  = nOR( WS_CHILD, WS_VISIBLE )
   ::cProgID = cProgID
   ::cString = ActXString( cProgID )

   ::Register()

   if ! Empty( oWnd:hWnd )
      ::Create()
      oWnd:AddControl( Self )
      ::hActiveX = CreateActiveX( ::hWnd, cProgID, Self )
      ::nTop = nRow
      ::nLeft = nCol
      ::nWidth = nWidth
      ::nHeight = nHeight
      ::ReadTypes()
   else
      oWnd:DefControl( Self )
   endif

return Self

//----------------------------------------------------------------------------//

METHOD Do( cMethodName, uParam1, uParam2, uParam3, uParam4 ) CLASS TActiveX

   local uRet

   do case
      case PCount() == 1
           uRet = ActXInvoke( ActXPdisp( ::hActiveX ), cMethodName )

      case PCount() == 2
           uRet = ActXInvoke( ActXPdisp( ::hActiveX ), cMethodName, uParam1 )

      case PCount() == 3
           uRet = ActXInvoke( ActXPdisp( ::hActiveX ), cMethodName, uParam1, uParam2 )

      case PCount() == 4
           uRet = ActXInvoke( ActXPdisp( ::hActiveX ), cMethodName, uParam1, uParam2,;
                              uParam3 )
      case PCount() == 5
           uRet = ActXInvoke( ActXPdisp( ::hActiveX ), cMethodName, uParam1, uParam2,;
                              uParam3, uParam4 )
   endcase

return uRet

//----------------------------------------------------------------------------//

METHOD ReDefine( nId, oWnd, cProgID ) CLASS TActiveX

   DEFAULT oWnd := GetWndDefault()
   
   ::nId     = nId
   ::oWnd    = oWnd
   ::cProgID = cProgID
   ::cString = ActXString( cProgID )

   ::Register( nOR( CS_VREDRAW, CS_HREDRAW ) )
   
   oWnd:DefControl( Self )

return Self

//----------------------------------------------------------------------------//

METHOD Initiate( hDlg ) CLASS TActiveX

   Super:Initiate( hDlg )

   ::hActiveX = CreateActiveX( ::hWnd, ::cProgID, Self )
   ::ReadTypes()

return nil

//----------------------------------------------------------------------------//

METHOD OnEvent( nEvent, aParams, pParams ) CLASS TActiveX

   local nAt := AScan( ::aEvents, { | aEvent | aEvent[ 2 ] == nEvent } )
   local cEvent := If( nAt != 0, ::aEvents[ nAt ][ 1 ], "" )
   
   if ! Empty( ::bOnEvent )
      Eval( ::bOnEvent, If( ! Empty( cEvent ), cEvent, nEvent ), aParams, pParams )
   endif   

return nil

//----------------------------------------------------------------------------//

METHOD ReadTypes() CLASS TActiveX

   local oReg := TReg32():New( HKEY_CLASSES_ROOT, "CLSID\" + ::cString + ;
                               "\InprocServer32" )
   local cTypeLib := oReg:Get( "" )

   oReg:Close()
   
   if ! Empty( cTypeLib ) .and. File( cTypeLib )
      ::aEvents = ActXEvents( cTypeLib, ::hActiveX )
   endif   

return nil

//----------------------------------------------------------------------------//
Posts: 3
Joined: Wed Jul 23, 2008 07:02 PM
Problemas en 8.06 con Activex
Posted: Thu Jul 24, 2008 01:24 PM

Antonio ?????

Posts: 297
Joined: Fri Apr 14, 2006 05:52 PM
Problemas en 8.06 con Activex
Posted: Thu Sep 04, 2008 12:15 AM

Antonio, Buenas noches, mira he estado examinando ejemplos con Crystal Report XI y me encuentro con el mismo problema de Fernando con la versi贸n 8.06, (la 7.12 no lo ten铆a). 驴Me prodr铆ais comentar cual fue la soluci贸n?

Muchas Gracias

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Problemas en 8.06 con Activex
Posted: Thu Sep 04, 2008 12:39 AM

Mike,

No es una soluci贸n simple, ya que se ha reescrito todo el motor de ActiveX internamente y ahora est谩 correcto.

Lo id贸neo es usar FWH 8.08 para tener los ActiveX funcionando perfectamente...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 297
Joined: Fri Apr 14, 2006 05:52 PM
Problemas en 8.06 con Activex
Posted: Thu Sep 04, 2008 07:19 AM

Muchas Gracias Antonio, lo que pasa es que tengo un proyecto terminado con FWH 8.06 y lo quer铆a pasar a la 8.08, pero tengo un peque帽o problemilla con otro control en la 8.08. De todas formas voy a pasarlo a la 8.08 e intento solventar el otro problemilla :D .

Posts: 396
Joined: Tue Mar 18, 2008 09:41 PM
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 04:32 PM
Hola,

Estoy implementando por primera vez el uso de CrystalReport.
Me he bajado la versi贸n Trial de Crystal Reports 2008 version 12.0.0.683

Pero cuando ejecuto mi programa se me queda colgado en la primera linea a la hora de crear el objeto.
No llega al paso numero dos.

驴alguna ayuda?
Code (fw): Select all Collapse
MsgInfo( "paso1" )

oCRApp := CreateObject( "CrystalRuntime.Application.12" )

MsgInfo( "paso2" )
Javier,

FWH 8.04 2008
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 07:00 PM

Javier,

Usas Harbour 贸 xHarbour ? Que versi贸n ?

Prueba ejemplos como FWH\samples\webexp.prg a ver si te funcionan bien

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 396
Joined: Tue Mar 18, 2008 09:41 PM
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 08:19 PM

Antonio,

Los ejemplos webexp me funcionan bien.

Uso FWH 8.04

Javier,

FWH 8.04 2008
Posts: 396
Joined: Tue Mar 18, 2008 09:41 PM
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 10:15 PM

Hola Antonio,

He mirado en el Crystal Reports 2008 versi贸n de prueba que tengo instalado.
Hay un apartado donde dice que mi licencia de prueba no dispone de API para creaci贸n de informes.

驴tendr谩 eso que ver?
驴ser谩 que no puede crear el objeto oCRApp := CreateObject( "CrystalRunTime.Application" )?

Javier,

FWH 8.04 2008
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 10:53 PM

Javier,

Pru茅balo de esta forma:

viewtopic.php?p=76788#p76788

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 396
Joined: Tue Mar 18, 2008 09:41 PM
Re: Problemas en 8.06 con Activex
Posted: Wed Apr 14, 2010 09:49 AM
Antonio,

Me sigue dando un error del tipo:

Code (fw): Select all Collapse
Subsystem:
TOLEauto

SubCode:
65535

Operation:
TOLEAUTO:NEW
Javier,

FWH 8.04 2008
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Problemas en 8.06 con Activex
Posted: Sun Apr 18, 2010 11:07 AM

Javier,

Parece que no es capaz de crear ese objeto OLE.

Prueba a crearlo desde Visual Basic (desde el propio editor de Macros del Word) a ver si consigue crearlo.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 396
Joined: Tue Mar 18, 2008 09:41 PM
Re: Problemas en 8.06 con Activex
Posted: Mon Apr 19, 2010 08:40 PM

Antonio,

No recuerdo como se hacia para crearlo desde VB.
驴me puedes pasar un ejemplo?

Javier,

FWH 8.04 2008