Problemas en 8.06 con Activex

jose.robertoteixeira
Posts: 3
Joined: Wed Jul 23, 2008 7:02 pm

I Have is Problem!

Post by jose.robertoteixeira »

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.
User avatar
Antonio Linares
Site Admin
Posts: 42643
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 59 times
Been thanked: 93 times
Contact:

Post by Antonio Linares »

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
jose.robertoteixeira
Posts: 3
Joined: Wed Jul 23, 2008 7:02 pm

Post by jose.robertoteixeira »

Hello A.Linares, the source is :



Code: Select all | Expand

// 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

//----------------------------------------------------------------------------//
jose.robertoteixeira
Posts: 3
Joined: Wed Jul 23, 2008 7:02 pm

Post by jose.robertoteixeira »

Antonio ?????
Mike Serra
Posts: 297
Joined: Fri Apr 14, 2006 5:52 pm
Location: Córdoba (España)

Post by Mike Serra »

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
User avatar
Antonio Linares
Site Admin
Posts: 42643
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 59 times
Been thanked: 93 times
Contact:

Post by Antonio Linares »

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
Mike Serra
Posts: 297
Joined: Fri Apr 14, 2006 5:52 pm
Location: Córdoba (España)

Post by Mike Serra »

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 .
jfafive
Posts: 396
Joined: Tue Mar 18, 2008 9:41 pm
Location: Marbella

Re: Problemas en 8.06 con Activex

Post by jfafive »

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: Select all | Expand


MsgInfo( "paso1" )

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

MsgInfo( "paso2" )
 
Javier,
FWH 8.04 2008
User avatar
Antonio Linares
Site Admin
Posts: 42643
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 59 times
Been thanked: 93 times
Contact:

Re: Problemas en 8.06 con Activex

Post by Antonio Linares »

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
jfafive
Posts: 396
Joined: Tue Mar 18, 2008 9:41 pm
Location: Marbella

Re: Problemas en 8.06 con Activex

Post by jfafive »

Antonio,

Los ejemplos webexp me funcionan bien.

Uso FWH 8.04
Javier,
FWH 8.04 2008
jfafive
Posts: 396
Joined: Tue Mar 18, 2008 9:41 pm
Location: Marbella

Re: Problemas en 8.06 con Activex

Post by jfafive »

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
User avatar
Antonio Linares
Site Admin
Posts: 42643
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 59 times
Been thanked: 93 times
Contact:

Re: Problemas en 8.06 con Activex

Post by Antonio Linares »

Javier,

Pruébalo de esta forma:
viewtopic.php?p=76788#p76788
regards, saludos

Antonio Linares
www.fivetechsoft.com
jfafive
Posts: 396
Joined: Tue Mar 18, 2008 9:41 pm
Location: Marbella

Re: Problemas en 8.06 con Activex

Post by jfafive »

Antonio,

Me sigue dando un error del tipo:

Code: Select all | Expand


Subsystem:
TOLEauto

SubCode:
65535

Operation:
TOLEAUTO:NEW
 
Javier,
FWH 8.04 2008
User avatar
Antonio Linares
Site Admin
Posts: 42643
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 59 times
Been thanked: 93 times
Contact:

Re: Problemas en 8.06 con Activex

Post by Antonio Linares »

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
jfafive
Posts: 396
Joined: Tue Mar 18, 2008 9:41 pm
Location: Marbella

Re: Problemas en 8.06 con Activex

Post by jfafive »

Antonio,

No recuerdo como se hacia para crearlo desde VB.
¿me puedes pasar un ejemplo?
Javier,
FWH 8.04 2008
Post Reply