FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TActiveX:SetProp()
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 04:02 PM

Reinaldo,

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

No, please lets do some more tests

Will your OCX work if you comment out this line ?

::oActiveX:do( "Reset" )

regards, saludos

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

Ok. No problem. Here is the new code:
METHOD Init() CLASS TMSSR300

	DEFINE WINDOW ::oWnd OF ::oOwner FROM -300, -300 TO -300, -300
	::oActiveX := TActiveX():New( ::oWnd, "MSSR300.MSSR300Ctrl.1" )
	::oActiveX:SetProp( "DataOnly", 1 )
	::oActiveX:SetProp( "NumChannels", 1 )  //line #82
	::oActiveX:SetProp( "RecordTimeLimit", 180 )
	::oActiveX:SetProp( "BitsPerSample", 100 )


I get a harbour exception error dialog.

ACTVXPDISP(0)
_EVAL(0)
TACTIVEX:SETPROP(0)
TVOICEREC:INIT(82)
...



Reinaldo.
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
TActiveX:SetProp()
Posted: Wed Jul 25, 2007 06:51 PM

Antonio;

Going back to the original problem. Perhaps there is a problem trying to send data from harbour/xharbour to VB Variant Data Type.

You may try with any OCX that expectes VB Variant Data type. You will find that you can't set an ocx property that expects Variant data type.

Just a thought.

Reinaldo.

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

Please modify these functions this way:
function OleGetProperty( hObj, cPropName )

   local o := TOleAuto()
   local uRet

   o:hObj = hObj
   uRet = __ObjSendMsg( o, cPropName )
   o:hObj = nil

return uRet

function OleSetProperty( hObj, cPropName, uValue )

   local o := TOleAuto()
   local uRet

   o:hObj = hObj
   uRet = __ObjSendMsg( o, "_" + cPropName, uValue )
   o:hObj = nil

return uRet

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 07:26 PM

Ok. Done.

Now I get the msginfo dialog any time an ocx method is called as expected with your code.

No errors.

But values do get assiged to the AcmFormat property that's expecting VB variant data type. It seems to work just fine.

Can I remove OleInvoke() and keep the rest?

Reinaldo.

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

OleInvoke() should be implemented this way:
function OleInvoke( hObj, cMethName, ... ) 

   local o := TOleAuto() 
   local uRet 

   o:hObj = hObj 
   uRet = o:Invoke( cMethName, ... ) 
   o:hObj = nil 

return uRet

I am looking for the right way to supply "..." variable params list
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion