Page 2 of 3
I Have is Problem!
Posted: Thu Jul 24, 2008 11:32 am
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.
Posted: Thu Jul 24, 2008 11:49 am
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
Posted: Thu Jul 24, 2008 11:55 am
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
//----------------------------------------------------------------------------//
Posted: Thu Jul 24, 2008 1:24 pm
by jose.robertoteixeira
Antonio ?????
Posted: Thu Sep 04, 2008 12:15 am
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
Posted: Thu Sep 04, 2008 12:39 am
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...
Posted: Thu Sep 04, 2008 7:19 am
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

.
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 4:32 pm
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" )
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 7:00 pm
by Antonio Linares
Javier,
Usas Harbour ó xHarbour ? Que versión ?
Prueba ejemplos como FWH\samples\webexp.prg a ver si te funcionan bien
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 8:19 pm
by jfafive
Antonio,
Los ejemplos webexp me funcionan bien.
Uso FWH 8.04
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 10:15 pm
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" )?
Re: Problemas en 8.06 con Activex
Posted: Tue Apr 13, 2010 10:53 pm
by Antonio Linares
Javier,
Pruébalo de esta forma:
viewtopic.php?p=76788#p76788
Re: Problemas en 8.06 con Activex
Posted: Wed Apr 14, 2010 9:49 am
by jfafive
Antonio,
Me sigue dando un error del tipo:
Re: Problemas en 8.06 con Activex
Posted: Sun Apr 18, 2010 11:07 am
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.
Re: Problemas en 8.06 con Activex
Posted: Mon Apr 19, 2010 8:40 pm
by jfafive
Antonio,
No recuerdo como se hacia para crearlo desde VB.
¿me puedes pasar un ejemplo?