ActiveX paramaters as Byte

ActiveX paramaters as Byte

Postby Biel EA6DD » Fri Sep 18, 2009 7:51 am

I'm using an ActivexControl, and I need to call one method, but the parameter must be Array Byte, anyway to do it?

For example this VB code runs ok
Code: Select all  Expand view

Dim blob() As Byte
 ' Read binary data from file.
 Open CommonDialog1.FileName For Binary As #1
 ReDim blob(LOF(1))
 Get #1, , blob()
 Close #1
 Templ.Deserialize blob

Thanks in advance.
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Re: ActiveX paramaters as Byte

Postby Antonio Linares » Fri Sep 18, 2009 1:06 pm

Biel,

Try using a Harbour array of numbers, i.e.:
{ 1, 2, 3, ... }

It gets converted into a SAFEARRAY which it is the way it is expected from the Activex side
regards, saludos

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

Re: ActiveX paramaters as Byte

Postby Biel EA6DD » Fri Sep 18, 2009 3:38 pm

Antonio thanks for answering,
Tested with array, but do not accept this kind of parameter, the program crash.

Code: Select all  Expand view

xVar1:=oTmp:Serialize()
oTmp:Deserialize( xVar1) //Runs Ok
 

Code: Select all  Expand view

xVar1:=oTmp:Serialize()
?ValType(xVar1) //  C
?Len(xVar1) //318
xVar2:=''
FOR i:=1 TO Len(xVar1)
   xVar2+=SubStr(xVar1,i,1)
NEXT
?Len(xVar2),Len(xVar1) //318 318
?ValType(xVar2), Valtype(xVar1) // C C
?xVar2==xVAr1  // .T.
oTmp:Deserialize( xVar1) //Runs Ok
oTmp:Deserialize( xVar2) //Crash
 
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Re: ActiveX paramaters as Byte

Postby Antonio Linares » Fri Sep 18, 2009 4:34 pm

Biel,

This is obvious, but have you tried it in this order ?
Code: Select all  Expand view

oTmp:Deserialize( xVar2) //Crash
oTmp:Deserialize( xVar1) //Runs Ok
 
regards, saludos

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

Re: ActiveX paramaters as Byte

Postby Biel EA6DD » Mon Sep 21, 2009 10:48 am

Yes I have tryed also, and not run.

As no one else has answered, please Antonio swtich to the spanish post , more easy for me.
http://forums.fivetechsupport.com/viewtopic.php?f=6&t=16732
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

Re: ActiveX paramaters as Byte

Postby Antonio Linares » Mon Sep 21, 2009 1:22 pm

Biel,

ok :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

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