IA

Re: IA

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

Re: IA

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

Re: IA

Postby Antonio Linares » Sun Apr 10, 2022 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42073
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: IA

Postby Jimmy » Mon Apr 11, 2022 5: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: Select all  Expand view
  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
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: IA

Postby Antonio Linares » Mon Apr 11, 2022 6:32 am

Jimmy,

very good!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42073
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 55 guests