Bug 1988 – more unicode

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-04-12T13:04:00Z
Last change time
2015-06-09T01:14:36Z
Assigned to
nobody
Creator
dfj1esp02

Attachments

IDFilenameSummaryContent-TypeSize
419windows.dmore unicode in windows.dtext/plain109901

Comments

Comment #0 by dfj1esp02 — 2008-04-12T13:04:25Z
I've encountered two issues: 1. windows applications with wWinMain don't link 2. MessageBoxW declaration is missing in std.c.windows.windows
Comment #1 by DimitarRosenovKolev — 2009-07-10T00:03:27Z
Hello I am new to D so hope this is not wrong. Go to dmd2\src\druntime\import\core\sys\windows.d In that file you can search for MessageBoxA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType); Add this line beneath it: MessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType); And beneath MessageBoxExA(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, WORD wLanguageId); Add this line: MessageBoxExW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType, WORD wLanguageId); As far as I know adding UNICODE support in WINDOWS is just a matter of adding LPCWSTR instead of LPCSTR. Tested it and it worked with one winsamp.d (D sample).
Comment #2 by DimitarRosenovKolev — 2009-07-10T03:22:25Z
Created attachment 419 more unicode in windows.d Added some unicode windows api functions. It compiles with the new 2.031 compiler. Did not test if all are working but I just added them as they are from Microsoft msdn.
Comment #3 by DimitarRosenovKolev — 2009-07-10T03:25:36Z
This is what I added inside the windows.d added: DWORD GetModuleFileNameW added: int MessageBoxW added: int MessageBoxExW added: export LONG RegDeleteKeyW added: export LONG RegDeleteValueW added: export LONG RegEnumKeyExW added: export LONG RegEnumValueW( added: export LONG RegOpenKeyW added: export LONG RegOpenKeyExW added: export LONG RegQueryInfoKeyW added: export LONG RegQueryValueW added: export LONG RegCreateKeyExW added: export LONG RegSetValueExW added: export DWORD ExpandEnvironmentStringsW( More to be added: Those need some enums. GetModuleFileNameExA GetModuleFileNameExW LoadLibraryExA LoadLibraryExW RegDeleteKeyExA RegDeleteKeyExW RegCreateKeyExA RegCreateKeyExW Do not know if those two exist: GetProcAddressA GetProcAddressW
Comment #4 by dfj1esp02 — 2009-07-10T03:51:07Z
GetProcAddress allows only ASCII strings.
Comment #5 by DimitarRosenovKolev — 2009-07-10T05:41:06Z
Thanks for the info. Feel free to review the file. When I have time I will put also the enums for the other messages. Tell me if there is no need for this.
Comment #6 by dfj1esp02 — 2009-07-13T02:07:17Z
you should contact with druntime team: create new bugreport product:d, component:druntime, keywords:patch and attach your modified file or better create a patch with the diff tool against the trunk version of windows.h
Comment #7 by DimitarRosenovKolev — 2009-07-13T12:00:18Z
Thanks for the info. Because I already added the other functions I have specified that I will add and I was going to add more but I did not know if that is necessary. I will contact the team and see what will happen.
Comment #8 by andrej.mitrovich — 2012-12-23T11:06:42Z
*** This issue has been marked as a duplicate of issue 317 ***