hb_CDPSELECT() crash ?

hb_CDPSELECT() crash ?

Postby Jimmy » Wed May 31, 2023 12:03 am

hi

i found another Mystery in DualGrid

in CONFIG.INI i use
[COUNTRY]
LangCode=DE
Codepage=DEWIN

which are used for
Code: Select all  Expand view
  hb_LangSelect( cLangCode )
   hb_CDPSELECT( cCodepage )


i can change
LangCode=EN

to check FWstring() Setting

but when set
Codepage=EN

it crash at Start with hb_out.log :shock:

Called from GDIP_IMAGEFROMFILE(0)
Called from FW_READIMAGE(1459) in .\source\function\IMGTXTIO.PRG
Called from (b)TWINDOW(602) in .\source\classes\WINDOW.PRG
Called from TDIALOG:READIMAGE(0) in .\source\classes\WINDOW.PRG
Called from TGRID:CLEARANDFILLDIR(1133) in .\TGRID.PRG
Called from TEXPLORER:FILLGRID(5183) in .\DUALGRID.PRG
Called from NOWBUILDGRID(1836) in .\DUALGRID.PRG
Called from (b)DOSPLASH(1777) in .\DUALGRID.PRG
Called from TWINDOW:ACTIVATE(1100) in .\source\classes\WINDOW.PRG
Called from DOSPLASH(1777) in .\DUALGRID.PRG
Called from (b)MAIN(903) in .\DUALGRID.PRG
Called from TWINDOW:ACTIVATE(1100) in .\source\classes\WINDOW.PRG
Called from MAIN(903) in .\DUALGRID.PRG


i don´t understand what hb_CDPSELECT() have to do with it as nothing of that CODE use Codepage, or :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: hb_CDPSELECT() crash ?

Postby nageswaragunupudi » Wed May 31, 2023 11:54 am

the first parameter of this function is a string.
string conversions depend on codepage.
invalid codepage may create problems at any point.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: hb_CDPSELECT() crash ?

Postby Antonio Linares » Wed May 31, 2023 11:56 am

Dear Jimmy,

What code do you have here ?

Called from TGRID:CLEARANDFILLDIR(1133) in .\TGRID.PRG
regards, saludos

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

Re: hb_CDPSELECT() crash ?

Postby karinha » Wed May 31, 2023 12:32 pm

Code: Select all  Expand view

#Include "FiveWin.ch"

REQUEST HB_CODEPAGE_HU852

FUNCTION Main()

   LOCAL cTxt := Chr( 71 ) + " > " + Chr( 144 ) + " is"

   ? hb_cdpSelect()                 // EN

   ? cTxt, Chr( 71 ) > Chr( 144 )   // G > É is .F.

   ? hb_cdpSelect( "HU852" )        // EN

   ? cTxt, Chr( 71 ) > Chr( 144 )   // G > É is .T.

   ? hb_cdpSelect( "EN" )           // HU852

   ? cTxt, Chr( 71 ) > Chr( 144 )   // G > É is .F.

RETURN NIL

/*
REQUEST HB_CODEPAGE_DE
REQUEST HB_CODEPAGE_DEWIN

FUNCTION Main()

   LOCAL cTxt := "A" + Chr( 142 ) + "BC"

   ? "German CP-850 text:", cTxt

   ? "German Windows-1252 text:", hb_Translate( cTxt, "DE", "DEWIN" )

RETURN NIL
*/


/*
REQUEST HB_LANG_PT
REQUEST HB_LANG_RO
REQUEST HB_LANG_ES

FUNCTION Main()

   HB_LANGSELECT( "pt" )       // Default language is now Portuguese

   ? CDOW( Date() )            // Segunda-feira

   ? "Old language id selected is ", HB_LANGSELECT()   // PT

   HB_LANGSELECT( "ro" )       // Default language is now Romanian

   ? CMONTH( Date() )          // Mai

   ? "Old language id selected is ", HB_LANGSELECT()   // RO

   HB_LANGSELECT( "es" )       // Default language is now Spanish

   ? CMONTH( Date() )          // Mayo

   ? CDOW( Date() )            // Lunes

RETURN NIL
*/


/*
REQUEST HB_LANG_EN
REQUEST HB_CODEPAGE_EN

REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850

FUNCTION Main()

   Local xAux
   Local aLang := { 'EN',  'PT850' }

   xAux := hb_langSelect( hb_UserLang(), aLang[ 1 ] )
   xAux := hb_cdpSelect( aLang[ 1 ] )

   ALERT( CHR( 157 ) + ';;' + aLang[ 1 ], , 'GR+/N' )

   xAux := hb_langSelect( hb_UserLang(), aLang[ 2 ] ) // .OR. HB_LANGSELECT( 'pt-BR', "PT850" )
   xAux := hb_cdpSelect( aLang[ 2 ] )

   ALERT( CHR( 157 ) + ';;' + aLang[ 2 ], , 'GR+/N' )

RETURN NIL
*/

 

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7794
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: hb_CDPSELECT() crash ?

Postby Jimmy » Wed May 31, 2023 5:04 pm

hi Antonio,

it happens in my DUALGRID App where i try to use FWstring()
the Error "seems" when use DIRECTORY() and try to find Icon of File

as i say it crash with hb_out.LOG so i don´t know "where" it crash

---

i have use Codepage only for DBF which i can change "on-fly"
when use FWstring() i can change Language-ID but why not Codepage-ID :?:


Jimmy
p.s. i have send Source of DUALGRID to Mr.Rao to show DELETED "Problem"
it should also show hb_cdpSelect() "Problem"
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: hb_CDPSELECT() crash ?

Postby nageswaragunupudi » Fri Jun 02, 2023 5:01 am

p.s. i have send Source of DUALGRID to Mr.Rao to show DELETED "Problem"
it should also show hb_cdpSelect() "Problem"

I did not receive.
Please send to
nageswaragunupudi[at]gmail[dot]com
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: hb_CDPSELECT() crash ?

Postby nageswaragunupudi » Fri Jun 02, 2023 5:01 am

p.s. i have send Source of DUALGRID to Mr.Rao to show DELETED "Problem"
it should also show hb_cdpSelect() "Problem"

I did not receive.
Please send to
nageswaragunupudi[at]gmail[dot]com
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: hb_CDPSELECT() crash ?

Postby nageswaragunupudi » Fri Jun 02, 2023 5:06 am

Can you copy and paste here the name of the file you got the problem?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: hb_CDPSELECT() crash ?

Postby Jimmy » Wed Jun 07, 2023 3:59 pm

hi,
nageswaragunupudi wrote:Can you copy and paste here the name of the file you got the problem?

did you receive DG_RAO.ZIP :?:

Files are "read" with DIRECTORY() so i can´t specify which Files make Problem.
btw. i always try NOT to use German "Umlaute" which may make Problem
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 53 guests