FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour IA
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Fri Apr 08, 2022 10:54 AM

Dear Jimmy,

I think CreateBinary() could be implemented like this:

HB_FUNC( CREATEBINARY )
{
hb_retclen( hb_parc( 1 ), hb_parclen( 1 ) );
}

or maybe we simply don't need it as Harbour strings can contain embedded zeroes

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Fri Apr 08, 2022 11:06 AM
I may be wrong as according to these docs:
http://www.yaldex.com/fox_pro_tutorial/html/cad2893d-9c63-4899-83d8-e5d58f79a414.htm

Visual FoxPro automatically converts binary data passed from an ActiveX control or automation object as an array of VT_UI1 type data to a Visual FoxPro character string. Visual FoxPro internally marks this character string as binary data passed from an ActiveX control or automation object. When the character string is passed back to an ActiveX control or automation object, Visual FoxPro automatically converts the character string to an array of VT_UI1 type data the ActiveX control or automation object expects.


We have examples of managing VT_UI1 type data in harbour/contrib/hbwin/olecore.c

look for VT_UI1 inside
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Sun Apr 10, 2022 08:01 AM

Maybe this:

include "hbole.ch"

lsink = CreateBinary( hb_MemoRead( "test.isf" ) )

...

function CreateBinary( cBinary )

return __oleVariantNew( WIN_VT_UI1, cBinary )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: IA
Posted: Mon Apr 11, 2022 05:54 AM
hi Antonio,

thx for Tip.

it seems that i need to "save" in IPF_Base64GIF instead of IPF_GIF
it will NOT produce a valid "GIF89a" so i can´t "display" it

but i can "load" it into INK simple with
Code (fw): Select all Collapse
   lsInk := hb_MemoRead( cFile )
   oInkOvl:Enabled := 0
   oInkOvl:ink:Load( lsInk )
   oInkOvl:Enabled := 1
   // draw it
   oInkOvl:Draw( oInkrectangle )
it now "display" in "INK" and i can press "recognize" :-)

Source ( HMG Syntax) can be found here
http://www.hmgforum.com/viewtopic.php?f=5&t=7219&p=68501
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: IA
Posted: Mon Apr 11, 2022 06:32 AM

Jimmy,

very good!

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion