Modify

Opened 15 years ago

Closed 15 years ago

#862 closed Bug (No Bug)

DllStructCreate DllStructSetData

Reported by: thesnow Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: Cc:

Description

$Struct=DllStructCreate("char var1[255];char var2[255]")
DllStructSetData($Struct,"var1","test") ;ansi char
DllStructSetData($Struct,"var2","测试") ;non-english char
MsgBox(0,"",DllStructGetData($Struct,"var1")) ;display "test",it's right
MsgBox(0,"",DllStructGetData($Struct,"var2")) ;display "测",it's error

Attachments (2)

test.zip (311 bytes) - added by thesnow 15 years ago.
bug exp
test2.zip (587 bytes) - added by thesnow 15 years ago.
exp 2

Download all attachments as: .zip

Change History (8)

Changed 15 years ago by thesnow

bug exp

comment:1 Changed 15 years ago by Jpm

I think you have to use wchar var2[255]
That's working on a nonchinese windows version

comment:2 Changed 15 years ago by anonymous

some win32api need char pointer.
wstr can use in dllcall(use in Struct can not work).but i want use Struct ,not dllcall.

Changed 15 years ago by thesnow

exp 2

comment:3 Changed 15 years ago by anonymous

There are a lot of AutoIt3 groups using Chinese fans, so suggest modify the bug.

forgive my poor English _

comment:4 Changed 15 years ago by Jpm

You have to use ShellAboutW with wstr and not ShellAbout.
ShellAbout is not using Unicode.
I cannot testit but

Return DllCall("shell32.dll","int","ShellAboutW", "hwnd",$hwnd, "wstr",$szApp, "wstr",$szOtherStuff, "hwnd",0)

should work

Such help info must go to forum before going here for bug fixing if any.

comment:5 Changed 15 years ago by thesnow

keywords is:
DllStructSetData drop some non-english text.
keywords is not use ShellAbout API.
I know ShellAboutW use wstr can work.


$Struct=DllStructCreate("char var1[255];char var2[255]")
DllStructSetData($Struct,"var1","test") ;ansi char
DllStructSetData($Struct,"var2","测试") ;non-english char
MsgBox(0,"",DllStructGetData($Struct,"var1")) ;display "test",it's right
MsgBox(0,"",DllStructGetData($Struct,"var2")) ;display "测",it's error


sorry. forgive me bad english.

comment:6 Changed 15 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

You cannot expect to keep unicode if you use char, you have to use wchar.
internally AutoIt work in UNICODE and do conversiion when you ask for.
Your conversion is impossible chinese is unicode and cannot be store in ANSI (char) string.

I close this report next time go to forum when you need help.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.