TActiveX:SetProp()

User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

TActiveX:SetProp()

Post by reinaldocrespo »

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:

Code: Select all

	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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

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

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

Antonio Linares
www.fivetechsoft.com
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

Antonio;

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



Reinaldo.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

Are you using harbour or xharbour ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

xharbour.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

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

and try it again
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

Please try this:

Code: Select all

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
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

I see what you are trying to do. But I'm using fwh Tactivex class. Now this piece of code fails.

Code: Select all

TRY
	::oActiveX := TActiveX():New( ::oWnd, "MSSR300.MSSR300Ctrl.1" )
END
I get the msginfo "not implemented yet".

Reinaldo.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

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

Code: Select all

function OleInvoke()

   x++

return nil 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

I did this instead:

Code: Select all

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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Reinaldo,

Don't you get more calls previous to ?

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

Antonio Linares
www.fivetechsoft.com
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

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.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Post by reinaldocrespo »

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:

Code: Select all

	::oActiveX:do( "Reset" )
But remember that I included:

Code: Select all

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.
Post Reply