Forum | | | | Stephan Sonneborn | Hello people, I stand still to the trouble, russian Texts on Dialogelemente To bring. The Texts lying in the meantime in a DLL in russischer Language to.
I create But not, these Texts darzustellen. it go always only question mark displayed.
How must I The Texts in the ANSI- area > 1024 address? I come with the WIDECHARS and WIDESTRINGS not clear...?!?! first of all must I The Texts from the DLL reading and of course so, that The information, that it kyrilische characters are with transfer becomes. with stand here always only question mark in the eingelesenen String.
has someone a idea? |
| | | XProfan X4Schöne Grüße aus Wittgenstein von Stephan Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 07/06/21 ▲ |
| |
| | Georg Teles | Hello Stephan,
If the windows Language to German is, is it normal, that The Texts through print as ??? get out, there print and SetText lest bypass can - other trouble is, that these Texts already in the Russichen exist, so You these as Ressource herauslesen and then transfiguring should, because ExtString$ not WideStrings bypass can.
The reason of my PCU [...] was very this, that one The Strings as latin in the program or DLL einfügt and then with the function umwandelt - l2cPCU.l2l of latin Strings To WideStrings and l2cPCU.l2c from the latin Strings To kyrillischen WideStrings
Regards |
| | | | |
| | Stephan Sonneborn | Hello Georg,
many Thanks for your response! so have I it over Umwege too made: One colleague has with of/ one english / russian keyboard The russian Texts "blind" association what about me Have whom Kauderwelsch from latin letters then uses, circa it with the CYRILLIC - Font darzustellen. But very unschön, because one always whom Font mitliefern must. now has another colleague directly russian Texts association. and a another everything again "richtig" on russian Translated.
I can tommorrow time a abgespeckte DLL take on... |
| | | Schöne Grüße aus Wittgenstein von Stephan
Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 07/07/21 ▲ |
| |
| | Georg Teles | The Texts can I you indeed in my shape translate, for PCU if You like
You can whom Text directly in the program or in the DLL mitliefern. there russiche Texts generally problematically on one deutschsprachigen PC are, is it of my opinion sinnvoller The Texts same in latin letters abzuspeichern (ansi) because the most Textfunktionen anyway just with Ansi what begin can ... these then in WideStrings transfiguring ind spend, then have you got The safety, that on each PC the same displayed becomes. |
| | | | |
| | Stephan Sonneborn | I Have here time one Testprogramm and a Mini-DLL three Texten drin:
DECLARE DLL$, DLL&, FONT&, HText&[3], HTextW&[3]
DECLARE Text$[3], TextW$[3]
DECLARE Buffer#, count&, address%,i%
DECLARE id%
DEF LoadStringW(4) !"USER32", "LoadStringW"
DEF IsMEnu(1) !"USER32", "IsMenu"
DEF CreateWindowExW(12) !"USER32", "CreateWindowExW"
DEF SetWindowTextW(2) !"USER32", "SetWindowTextW"
DIM Buffer#,4097
STRUCT CREATESTRUCT = lpCreateParams&, hInstance&, hMenu&, hwndParent&, cy%, cx%, y%, x%, style&, lpszName&, lpszClass&, dwExStyle&
'*****************************************************************************************************************'
'* ORDW, CHRW, UTF, CREATEW
'*****************************************************************************************************************'
proc ordw
parameters s$
declare m#
dim m#,2
char m#,0=left$(s$+"\z\z",2)
var wc&=word(m#,0)
dispose m#
return wc&
endproc
'*****************************************************************************************************************'
proc chrw
parameters wc&
declare m#
dim m#,2
word m#,0=wc&
var s$=char$(m#,0,2)
dispose m#
return s$
endproc
'*****************************************************************************************************************'
Proc UTF
parameters Text$
declare b#
Dim b#,2*len(text $)+2
StringW b#,0 = Text$
Text$ = Char$(b #,0,SizeOf(b#)-2)
return Text$
ENDPROC
'*****************************************************************************************************************'
Proc CreateW
parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&,exstyle&
case %pCount <11 : exstyle& = 0
Class$ = UTF(Class$)
name$ = UTF(name$)
Var cs# = New(CREATESTRUCT)
With cs#
.lpCreateParams& = SizeOf(cs#)
.hInstance& = hInst&
.hMenu& = (IsMenu(id%)<>0) * id%
.hwndParent& = pWnd&
.cy% = dy%
.cx% = dx%
.y% = y%
.x% = x%
.style& = style&
.lpszName& = Addr(name$)
.lpszClass& = Addr(Class$)
.dwExStyle& = exstyle&
EndWith
Var handle& = CreateWindowExW(exstyle&,Addr(Class$),Addr(name$),style&,x%,y%,dx%,dy%,pWnd&,id%,hInst&,cs#)
Class$ = WinError$(%WinError)
inc id%
Ifnot handle&
MessageBox("Es trod following Error on:\n\n" + Class$,"F E H L E R !!!",4096)
EndIf
Dispose cs#
Return handle&
ENDPROC
'*****************************************************************************************************************'
'*****************************************************************************************************************'
'* Hauptprogramm'
'*****************************************************************************************************************'
DLL$ ="DLL_RU_Test.DLL"
DLL&=USEDLL(DLL$)
id% = 1
CLS
SET("CHARSET", 1251)
Font&=Create("FONT", "calibri",0,0,0,0,0)
HText&[1] = create("Static",%HWND,"1", 10,10,200,20)
HText&[2] = create("Static",%HWND,"2", 10,40,200,20)
HText&[3] = create("Static",%HWND,"3", 10,70,200,20)
HTextW&[1] = createW("static","W1", $50000000,250,10,200,20,%HWND,0,%HINSTANCE)
HTextW&[2] = createW("static","W2", $50000000,250,40,200,20,%HWND,0,%HINSTANCE)
HTextW&[3] = createW("static","W3", $50000000,250,70,200,20,%HWND,0,%HINSTANCE)
SETFONT HText&[1], Font&
SETFONT HText&[2], Font&
SETFONT HText&[3], Font&
SETFONT HTextW&[1], Font&
SETFONT HTextW&[2], Font&
SETFONT HTextW&[3], Font&
WAITINPUT
Adresse% = 99
WHILELOOP 1,3,1
CLEAR Buffer#
count& = LoadStringW(DLL&, address%+&LOOP, Buffer#, 4097)
Text$[&LOOP] = EXTSTRING$ (DLL&, address%+&LOOP)
TextW$[&LOOP] = WIDECHAR(Buffer#,0,count&*2)
SETTEXT HText&[&LOOP], Text$[&LOOP]
SETTEXT HTextW&[&LOOP], TextW$[&LOOP]
WEND
WAITINPUT
DISPOSE Buffer#
DELETEOBJECT Font&
FREEDLL DLL&
END
|
| | | XProfan X4Schöne Grüße aus Wittgenstein von Stephan Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 07/08/21 ▲ |
| |
| | Georg Teles | Hi Stephan, have your View source adjusted, so might it weg
DECLARE DLL$, DLL&, FONT&, HText&[3], HTextW&[3]
DECLARE Text$[3], TextW$[3]
DECLARE Buffer#, count&, address%,i%
DECLARE id%
DEF LoadStringW(4) !"USER32", "LoadStringW"
DEF IsMEnu(1) !"USER32", "IsMenu"
DEF CreateWindowExW(12) !"USER32", "CreateWindowExW"
DEF SetWindowTextW(2) !"USER32", "SetWindowTextW"
DIM Buffer#,4097
STRUCT CREATESTRUCT = lpCreateParams&, hInstance&, hMenu&, hwndParent&, cy%, cx%, y%, x%, style&, lpszName&, lpszClass&, dwExStyle&
'*****************************************************************************************************************'
'* ORDW, CHRW, UTF, CREATEW
'*****************************************************************************************************************'
proc ordw
parameters s$
declare m#
dim m#,2
char m#,0=left$(s$+"\z\z",2)
var wc&=word(m#,0)
dispose m#
return wc&
endproc
'*****************************************************************************************************************'
proc chrw
parameters wc&
declare m#
dim m#,2
word m#,0=wc&
var s$=char$(m#,0,2)
dispose m#
return s$
endproc
'*****************************************************************************************************************'
Proc UTF
parameters Text$
declare b#
Dim b#,2*len(text $)+2
StringW b#,0 = Text$
Text$ = Char$(b #,0,SizeOf(b#)-2)
return Text$
ENDPROC
'*****************************************************************************************************************'
Proc CreateW
parameters Class$,name$,style&,x%,y%,dx%,dy%,pWnd&,pid%,hInst&,exstyle&
case %pCount <11 : exstyle& = 0
Class$ = UTF(Class$)
name$ = UTF(name$)
Var cs# = New(CREATESTRUCT)
With cs#
.lpCreateParams& = SizeOf(cs#)
.hInstance& = hInst&
.hMenu& = (IsMenu(id%)<>0) * id%
.hwndParent& = pWnd&
.cy% = dy%
.cx% = dx%
.y% = y%
.x% = x%
.style& = style&
.lpszName& = Addr(name$)
.lpszClass& = Addr(Class$)
.dwExStyle& = exstyle&
EndWith
Var handle& = CreateWindowExW(exstyle&,Addr(Class$),Addr(name$),style&,x%,y%,dx%,dy%,pWnd&,id%,hInst&,cs#)
Class$ = WinError$(%WinError)
inc id%
Ifnot handle&
MessageBox("Es trod following Error on:\n\n" + Class$,"F E H L E R !!!",4096)
EndIf
Dispose cs#
Return handle&
ENDPROC
'*****************************************************************************************************************'
'*****************************************************************************************************************'
'* Hauptprogramm'
'*****************************************************************************************************************'
DLL$ ="DLL_RU_Test.DLL"
DLL&=USEDLL(DLL$)
id% = 1
CLS
SET("CHARSET", 1251)
Font&=Create("FONT", "calibri",0,0,0,0,0)
HText&[1] = create("Static",%HWND,"1", 10,10,200,20)
HText&[2] = create("Static",%HWND,"2", 10,40,200,20)
HText&[3] = create("Static",%HWND,"3", 10,70,200,20)
HTextW&[1] = createW("static","W1", $50000000,250,10,200,20,%HWND,0,%HINSTANCE)
HTextW&[2] = createW("static","W2", $50000000,250,40,200,20,%HWND,0,%HINSTANCE)
HTextW&[3] = createW("static","W3", $50000000,250,70,200,20,%HWND,0,%HINSTANCE)
SETFONT HText&[1], Font&
SETFONT HText&[2], Font&
SETFONT HText&[3], Font&
SETFONT HTextW&[1], Font&
SETFONT HTextW&[2], Font&
SETFONT HTextW&[3], Font&
WAITINPUT
Adresse% = 99
WHILELOOP 1,3,1
CLEAR Buffer#
count& = LoadStringW(DLL&, address%+&LOOP, Buffer#, 4097)
TextW$[&LOOP] = c2w(Buffer#,count&*2)'byte for byte read !!!
SetWindowTextW(HText&[&LOOP], Addr(TextW$[&LOOP]))'Set...W
SetWindowTextW(HTextW&[&LOOP], Addr(TextW$[&LOOP]))'Set...W
'Text$[&LOOP] = EXTSTRING$ (DLL&, address%+&LOOP)
'TextW$[&LOOP] = WIDECHAR(Buffer#,0,count&*2)
'SETTEXT HText&[&LOOP], Text$[&LOOP]
'SETTEXT HTextW&[&LOOP], TextW$[&LOOP]
WEND
WAITINPUT
DISPOSE Buffer#
DELETEOBJECT Font&
FREEDLL DLL&
END
WEND
Proc c2w'byte for byte read
Parameters buf#, siz&
Declare wide$
Clear wide$
WhileLoop 0,(siz&-1)
wide$ = wide$+Chr$(byte(buf#,&loop))'+Chr$(4) CHR(4) entfällt, there Buffer# already as Wide loaded watts !!! with normalem String should one here whom CHR(4) yet append
EndWhile
Return wide$
ENDPROC
Regards Georg |
| | | | |
| | Stephan Sonneborn | Hello Georg,
super! the works lovely!
The Knackpunkt was So the byte-point reading the Texts and the settle over SETWINDOWTEXTW() with target the Textadresse.
Vielen, many Thanks! |
| | | XProfan X4Schöne Grüße aus Wittgenstein von Stephan Programmierumgebung:| XProfan X4 | WIN10 | AMD FX6100 3,3 GHz | 07/13/21 ▲ |
| |
|
AnswerThemeninformationenthis Topic has 2 subscriber: |