News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Unicode in Windows API

Started by russose, January 16, 2006, 03:50:52 PM

Previous topic - Next topic

russose

Hallo,

For pocketpc, Windows API functions are only implemented in UNICODE.
I compiled my application in ANSI with Code::Block and it works very fine. But to debug on my PC my pocketpc application, I would like to use EXACLTY the same code that's why I try to compiled it defining "UNICODE" in compiler option to use the Unicode version of Windows API.

And then, my application gives me a segmentation fault with the following (it is only a part):

#1 006C50FD   GHOST_SystemWinCE::s_wndProc(hwnd=0x70252, msg=36, wParam=0, lParam=2291016) (../../../../WinCE/intern/ghost/intern/Win32/WinCE/GHOST_SystemWinCE.cpp:600)
#2 77D13A5F   USER32!CreateWindowExA() (C:\WINDOWS\system32\user32.dll:??)
#3 77D13B2E   USER32!CreateWindowExA() (C:\WINDOWS\system32\user32.dll:??)
#4 77D15874   UserClientDllInitialize() (C:\WINDOWS\system32\user32.dll:??)
#5 77D1A482   USER32!RegisterWindowMessageA() (C:\WINDOWS\system32\user32.dll:??)
#6 77F4108F   ntdll!LdrDestroyOutOfProcessImage() (ntdll.dll:??)

We can see that ANSI version of API functions are used (CreateWindowExA and Register-WindowMessageA instead of CreateWindowExW, RegisterWindowMessageW).

Everywhere else, Unicode version are good used.

I am sure to define UNICODE everywhere and only these two functions are Ansi instead of Unicode. So the problem is coming from a top level library like win32api or another.

Has someone any idea about it? I will better check the library I used to link with my applica-tion. I also found:

http://libunicows.sourceforge.net/

I will try also.

Is there maybe a compiler option to define to say mingw to use Unicode API functions? Or a special library to link?

Thanks for your help,
Salvatore

russose

Hallo,

I solved the problem... I was linking in my code (to control PocketPC hardware buttons) against coredll! As soon as I exclude this library, of course it works :=)

Salvatore