TActiveX:SetProp()

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

Post by reinaldocrespo »

Antonio;

Ok. No problem. Here is the new code:

Code: Select all

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

Post by reinaldocrespo »

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.
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 modify these functions this way:

Code: Select all

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

Post by reinaldocrespo »

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

Post by Antonio Linares »

Reinaldo,

OleInvoke() should be implemented this way:

Code: Select all

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