FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TMultiGet Unicode problem.(UNSOLVED)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 07:10 AM

I have no idea how to set mines as yours. I am just runing your example

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 07:55 AM
Hi Antonio,

Thank you very much for your efforts.

Can i solve my problem using bLostfocus?
TMultiGet():bLostFocus := {|o, hWndGetFocus|Change_TMultiGet_Result(o)}


@ 15,15 get oGet1 var cVar1 MEMO;
		size 200,40 of oDlg pixel

FUNCTION Change_TMultiGet_Result(o)
LOCAL cText := o:GetText()
	cText := UTF8toAnsi(cText)
	o:SetText(cText)
RETURN
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 08:29 AM
Hi Antonio,
@ 15,15 get oGet1 var cVar1 MEMO;
		size 200,40 of oDlg pixel
oGet1:bLostFocus := {|o, hWndGetFocus|Change_TMultiGet_Result(o)}

FUNCTION Change_TMultiGet_Result(o)
LOCAL cText := o:GetText()
? "Before", FW_SetUnicode(), IsUTF8(cText), o:lUnicode, cText, StrToHex( cText, " " )
	cText := UTF8toAnsi(cText)
? "After", FW_SetUnicode(), IsUTF8(cText), o:lUnicode, cText, StrToHex( cText, " " )
	Eval( o:bSetGet, cText)

	cText := o:GetText()	
? "After than", FW_SetUnicode(), IsUTF8(cText), o:lUnicode, cText, StrToHex( cText, " " )   <-------------- I can not change the value. Why?
RETURN
I can not change the value of memo variable. ?

Also it does not work below.
TMultiGet():bLostFocus := {|o, hWndGetFocus|Change_TMultiGet_Result(o)}
Thanks.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 09:58 AM

Try with public or private cVar1

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 11:27 AM
Antonio Linares wrote: Try with public or private cVar1
Sory, I do not understand.Please give me some example.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 11:43 AM
public cVar1

@ 15,15 get oGet1 var cVar1 MEMO;
		size 200,40 of oDlg pixel
oGet1:bLostFocus := {|o, hWndGetFocus|Change_TMultiGet_Result(o)}

FUNCTION Change_TMultiGet_Result(o)
LOCAL cText := o:GetText()
? "Before", FW_SetUnicode(), IsUTF8(cText), o:lUnicode, cText, StrToHex( cText, " " )
	cText := UTF8toAnsi(cText)
? "After", FW_SetUnicode(), IsUTF8(cText), o:lUnicode, cText, StrToHex( cText, " " )
	Eval( o:bSetGet, cText)
        cVar1 = cText
	cText := o:GetText()	
? "After than", FW_SetUnicode(), IsUTF8(cText), o:lUnicode, cText, StrToHex( cText, " " )   <-------------- I can not change the value. Why?
RETURN
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 01:42 PM

Thank you very much Antonio,

If there were only one GET with MEMO, this process wouldn't be necessary. I don't think this solution makes sense to me.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 02:13 PM

You could try it this way:

oGet1:bLostFocus := {|o, hWndGetFocus|Change_TMultiGet_Result(o,@cVar1)}

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 04:21 PM
Antonio Linares wrote: You could try it this way:

oGet1:bLostFocus := {|o, hWndGetFocus|Change_TMultiGet_Result(o,@cVar1)}
Hi Antonio,

You mean I should write this in every GET with MEMO? Can not change cVar1 variables value in bLostFocus block?

Can't we define a single TMultiGet():bLostFocus at the beginning of the application? (using CLASDATA)
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMultiGet Unicode problem.
Posted: Thu Jul 31, 2025 05:04 PM

Dear Hakan,

I am just trying to understand what is happening and trying to help you.

I don't know where the problem comes from as I can not reproduce it here, sorry.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.(UNSOLVED)
Posted: Sat Aug 09, 2025 05:47 PM

Hi Antonio,

I would like to remind you that this error occurred when I added a manifest.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
Re: TMultiGet Unicode problem.(UNSOLVED)
Posted: Sat Aug 09, 2025 10:43 PM

Hi again,

Sorry for delay. I'm in vacation.

I don't use TMultiGet for my apps. I use RTF control for this.

I will look your problem and I will write a result in a few days.

Best regards,
Ertan,

ertan_ozturk@yahoo.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: TMultiGet Unicode problem.(UNSOLVED)
Posted: Sun Aug 10, 2025 07:31 AM

Hi ertan.

Thank you very much.

I have an example with rc. just compile it with rc and without rc.

The cVar1 variable is not the same in both compilations. I'm not using Unicode in my application. Pressing ฤž in the TMultiget command should return D0. When I use a theme (with the manifest), the result is Unicode C4 9E. I don't want a Unicode result.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 61
Joined: Wed Jul 26, 2023 12:08 PM
Re: TMultiGet Unicode problem.(UNSOLVED)
Posted: Sun Aug 10, 2025 08:00 AM

Dear Hakan,

Can you send your samples and executables to my e-mail?

ertan{underscore]ozturk[at]yahoo[dot]com

Best regards,
Ertan,

ertan_ozturk@yahoo.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TMultiGet Unicode problem.(UNSOLVED)
Posted: Sun Aug 10, 2025 08:52 AM
hakan.prg
#include "FiveWin.ch"

request HB_CODEPAGE_UTF8
request HB_CODEPAGE_UTF16LE
REQUEST HB_CODEPAGE_TRWIN

Function Main()
	Local oDlg, oFont
	Local oGet1
	local cVar1 := space(200)
	
	HB_CDPSELECT( "TRWIN" )
	FW_SetUnicode( .f. )
	TFont():nDefaultCharSet  := 162
	
    ? HB_CDPUNIID(), GetACP(), GetOEMCP()

	oFont := TFont():New("Verdana", 0, -11) 
	
	DEFINE DIALOG oDlg SIZE 500,150 PIXEL ;
		FONT oFont TITLE "Sample" ;
		STYLE nOr( WS_OVERLAPPEDWINDOW ) transparent
				
	@ 15,15 get oGet1 var cVar1 MEMO;
		size 200,40 of oDlg pixel 

   @ 60, 15 BUTTON "CHECK" SIZE 40, 10 PIXEL OF oDlg ;
      ACTION MsgInfo( ;
        "FW_SetUnicode():    " + cValToChar(FW_SetUnicode()) + CRLF + CRLF + ;
        "IsUTF8(cVar1):      " + cValToChar(IsUTF8(cVar1)) + CRLF + CRLF + ;
        "oGet1:lUnicode:     " + cValToChar(oGet1:lUnicode)  + CRLF + CRLF + ;
        "oDlg:lUnicode:      " + cValToChar(oDlg:lUnicode)  + CRLF + CRLF + ;
        "oGet1/TMultiGet():  " + cVar1 + " - " + StrToHex( cVar1, " " ) ;
         )  
			
	ACTIVATE DIALOG oDlg CENTER 
	
return nil

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( GETACP )   { hb_retni( GetACP() ); }
HB_FUNC( GETOEMCP ) { hb_retni( GetOEMCP() ); }

#pragma ENDDUMP
hakan.rc
ico  ICON "./../ICONS/fivewin.ico"

#ifndef __64__
  1 24 "WinXP/WindowsXP.Manifest" 
#else
  1 24 "WinXP/WindowsXP.Manifest64"
#endif
regards, saludos

Antonio Linares
www.fivetechsoft.com