TActiveX:SetProp()

TActiveX:SetProp()

Postby reinaldocrespo » Tue Jul 24, 2007 8: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:
Code: Select all  Expand view
   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
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

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

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

Postby Antonio Linares » Wed Jul 25, 2007 11:17 am

Reinaldo,

Are you using harbour or xharbour ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby reinaldocrespo » Wed Jul 25, 2007 12:45 pm

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

Postby Antonio Linares » Wed Jul 25, 2007 1:22 pm

Reinaldo,

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

and try it again
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby reinaldocrespo » Wed Jul 25, 2007 1: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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Antonio Linares » Wed Jul 25, 2007 2:00 pm

Reinaldo,

Please try this:
Code: Select all  Expand view
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
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby reinaldocrespo » Wed Jul 25, 2007 2:20 pm

I see what you are trying to do. But I'm using fwh Tactivex class. Now this piece of code fails.
Code: Select all  Expand view
TRY
   ::oActiveX := TActiveX():New( ::oWnd, "MSSR300.MSSR300Ctrl.1" )
END


I get the msginfo "not implemented yet".

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

Postby Antonio Linares » Wed Jul 25, 2007 2:49 pm

Reinaldo,

Please make this change to force an error and see where OleInvoke() is called from, thanks
Code: Select all  Expand view
function OleInvoke()

   x++

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby reinaldocrespo » Wed Jul 25, 2007 3:13 pm

I did this instead:
Code: Select all  Expand view
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
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Antonio Linares » Wed Jul 25, 2007 3: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby reinaldocrespo » Wed Jul 25, 2007 3: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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby Antonio Linares » Wed Jul 25, 2007 3: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42078
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby reinaldocrespo » Wed Jul 25, 2007 3: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:
Code: Select all  Expand view
   ::oActiveX:do( "Reset" )


But remember that I included:
Code: Select all  Expand view
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.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 25 guests