IA

User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: IA

Post by Antonio Linares »

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
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: IA

Post by Antonio Linares »

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
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: IA

Post by Antonio Linares »

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
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: IA

Post by Jimmy »

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: Select all | Expand

  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
Image
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42529
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 77 times
Contact:

Re: IA

Post by Antonio Linares »

Jimmy,

very good!
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply