FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TActiveX:SetProp()
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Tue Jul 24, 2007 08:33 PM
Hi.

I'm having a problem setting one specific property to an ocx I'm using. All else works just fine.

From the OCX guide, the property data type is described as:


VARIANT=> Variant type (C/C++ type OLEVARIANT, Delphi type OleVariant, VB
type Variant (default type))
...And can be assigned to the .AcmFormat property directly, e.g.:
ocx.AcmFormat = "31000100401f0000590600004100000002004001"


On my fwh code I'm assigning this way:
	cAcmString := "55000100c05d0000b80b0000010000000c00010002000000480001007105"

	::oActiveX:SetProp( "AcmFormat", cAcmString )


But it does not seem to work. After the property has been set (with the code above), when quering it I get back Nil which is the default value before it is set.

Can anyone help with this one?



Reinaldo.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Tue Jul 24, 2007 10:23 PM

Reinaldo,

have you tried to assign a shorter string, just for a test ?

::oActiveX:SetProp( "AcmFormat", "123" )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Tue Jul 24, 2007 10:56 PM

Antonio;

Yes, I have. Nothing gets assigned. I think it has to do with the Variant data type that is expected.

Reinaldo.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 11:17 AM

Reinaldo,

Are you using harbour or xharbour ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 12:45 PM

xharbour.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 01:22 PM

Reinaldo,

Please do this: tlib fivehc.lib - ole.obj

and try it again

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 01:42 PM

Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_HB_FUN_OLEGETPROPERTY' referenced from F:\FWH_2.7\LIB\FIVEHC.LIB|ACTX
Error: Unresolved external '_HB_FUN_OLESETPROPERTY' referenced from F:\FWH_2.7\LIB\FIVEHC.LIB|ACTX
Error: Unresolved external '_HB_FUN_OLEINVOKE' referenced from F:\FWH_2.7\LIB\FIVEHC.LIB|ACTX


Reinaldo.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 02:00 PM
Reinaldo,

Please try this:
function OleGetProperty( hObj, cPropName )

   local o := TOleAuto()

   o:hObj = hObj

return __ObjSendMsg( o, cPropName )

function OleSetProperty( hObj, cPropName, uValue )

   local o := TOleAuto()

   o:hObj = hObj

return __ObjSendMsg( o, "_" + cPropName, uValue )

function OleInvoke()

   MsgInfo( "not implemented yet" )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 02:20 PM
I see what you are trying to do. But I'm using fwh Tactivex class. Now this piece of code fails.
TRY
	::oActiveX := TActiveX():New( ::oWnd, "MSSR300.MSSR300Ctrl.1" )
END


I get the msginfo "not implemented yet".

Reinaldo.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 02:49 PM
Reinaldo,

Please make this change to force an error and see where OleInvoke() is called from, thanks
function OleInvoke()

   x++

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 03:13 PM
I did this instead:
function OleInvoke() 
local x
   x++ 

return nil


Got this:

Application
===========
Path and name: F:\mp\PathLabs.exe (32 bits)
Size: 3,274,752 bytes
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 07/25/2007, 11:11:18
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = U
[ 2] = N 1

Stack Calls
===========
Called from: => ACTXINVOKE(795)
Called from: ACTIVEX.PRG => TACTIVEX:DO(0)


Reinaldo.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 03:17 PM

Reinaldo,

Don't you get more calls previous to ?

Called from: ACTIVEX.PRG => TACTIVEX:DO(0)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 03:22 PM
No. That's an actual cut and paste from the error.log file.

Here is the complete list:


Application
===========
Path and name: F:\mp\PathLabs.exe (32 bits)
Size: 3,274,752 bytes
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 07/25/2007, 11:11:18
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = U
[ 2] = N 1

Stack Calls
===========
Called from: => ACTXINVOKE(795)
Called from: ACTIVEX.PRG => TACTIVEX:DO(0)
Called from: tVoiceRec.prg => TMSSR300:INIT(57)
Called from: tVoiceRec.prg => TVOICEREC:NEW(163)
Called from: => DOACCNTSBRWSER(1154)
Called from: pathlogn.prg => ACCNTSBRWSER(1075)
Called from: main.prg => (b)FRAMEBAR(377)
Called from: tsbutton.prg => TSBUTTON:CLICK(804)
Called from: CONTROL.PRG => TCONTROL:HANDLEEVENT(0)
Called from: tsbutton.prg => TSBUTTON:HANDLEEVENT(1308)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: main.prg => START(80)


Nothing else.


Reinaldo.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 03:48 PM

Reinaldo,

What source code do you have here ?

tVoiceRec.prg => TMSSR300:INIT(57)

Try to comment it out, if possible

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 03:59 PM
Antonio,

Application
===========
Path and name: F:\mp\PathLabs.exe (32 bits)
Size: 3,274,752 bytes
Time from start: 0 hours 0 mins 6 secs
Error occurred at: 07/25/2007, 11:53:28
Error description: Error BASE/1081 Argument error: +
Args:
[ 1] = U
[ 2] = N 1

Stack Calls
===========
Called from: => ACTXINVOKE(789)
Called from: ACTIVEX.PRG => TACTIVEX:DO(0)
Called from: tVoiceRec.prg => TMSSR300:INIT(57)
Called from: tVoiceRec.prg => TVOICEREC:NEW(164)
Called from: => DOACCNTSBRWSER(1154)


Line 57 is:
	::oActiveX:do( "Reset" )


But remember that I included:
function OleInvoke()
local x
   x++    //<== this is line 789

return nil


Please allow me to send you the ocx with its documentation and sample code for your testing. I can create a very small .prg sample code.


Reinaldo.