TActiveX:SetProp()

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

Postby reinaldocrespo » Wed Jul 25, 2007 4:35 pm

Antonio;

Ok. No problem. Here is the new code:
Code: Select all  Expand view  RUN
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: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

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

Postby Antonio Linares » Wed Jul 25, 2007 7:08 pm

Reinaldo,

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

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

Postby Antonio Linares » Wed Jul 25, 2007 8:04 pm

Reinaldo,

OleInvoke() should be implemented this way:
Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42103
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 66 guests