Page 2 of 2
Posted: Wed Jul 25, 2007 4:02 pm
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" )
Posted: Wed Jul 25, 2007 4:35 pm
by reinaldocrespo
Antonio;
Ok. No problem. Here is the new code:
Code: Select all | Expand
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.
Posted: Wed Jul 25, 2007 6:51 pm
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.
Posted: Wed Jul 25, 2007 7:08 pm
by Antonio Linares
Reinaldo,
Please modify these functions this way:
Code: Select all | Expand
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
Posted: Wed Jul 25, 2007 7:26 pm
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.
Posted: Wed Jul 25, 2007 8:04 pm
by Antonio Linares
Reinaldo,
OleInvoke() should be implemented this way:
Code: Select all | Expand
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