On 29.08.2007 15:17, res wrote: > On 29.08.2007 12:50, Piotr Obrzut wrote: >> That's true, though I see same problems in CS wx plugin, check >> "csGraphics2DWX::FindPixelFormat" (you will find 'RegisterClassA', or >> "const char* dummyClassName = "CSGL_DummyWindow";"). > > You're mixing up Win32 and WX. > > On Win32, CS should never be compiled with UNICODE set. We don't have to > check for that. No need for #ifdefs, just use *A functions all the time.
To clarify and explain: not by default. You can of course set UNICODE manually (FWIW, WX does not set it - it uses '_UNICODE'. The _'s all the difference), but on Win32 CS is generally agnostic towards that define - that is, generally either the *A or *W variation of a Win32 API are called explicitly. So the proper fix when you ran into problems compiling wxgl with UNICODE set would have been to change CreateWindow to CreateWindowA. Also, the "undecorated" API names are actually macros #defined to the *A or *W version, depending on whether UNICODE was set. So constructs like '#ifdef UNICODE / FooW(); / #else / FooA(); / #endif' are pointless as "Foo" would have been set to the right identifier, 'Foo();' would have been sufficient. So to summarize: you missed to change the right Win32 to be an explicit *A call, but "fixed" the other API calls in an unnecessary complicated way ;) This is just the Win32 API. WX is a slightly different deal. There it's important to use wxT() for constant strings and wxString whenever possible. A catch is when you need to convert wxStrings to const char*s (or const wchar_t*s), you need some extra calls or so there. -f.r.
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________ Crystal-main mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-main Unsubscribe: mailto:[EMAIL PROTECTED]
