From: scottc AT net-community DOT com (Scott Christley) Subject: Re: header files (continued) 13 Nov 1996 17:34:46 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199611131111.DAA10903.cygnus.gnu-win32@stetson.net-community.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Sender: scottc AT net-community DOT com X-Mailer: Windows Eudora Light Version 1.5.2 Original-To: root AT jacob DOT remcomp DOT fr (root), gnu-win32 AT cygnus DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi Jacob, Good suggestion; I will put it on my todo list for the windows32api library. Scott At 06:17 PM 11/12/96 +0100, root wrote: >The policy in the header files concerning UNICODE is that both functions >(the W and A last letters) are defined. Both CreateWindowW and CreateWindowW >are available. > >It is not the same for structures though. Consider this structure as is now >defined in the gnu windows headers: >typedef struct tagLOGFONT { > LONG lfHeight; > LONG lfWidth; > LONG lfEscapement; > LONG lfOrientation; > LONG lfWeight; > BYTE lfItalic; > BYTE lfUnderline; > BYTE lfStrikeOut; > BYTE lfCharSet; > BYTE lfOutPrecision; > BYTE lfClipPrecision; > BYTE lfQuality; > BYTE lfPitchAndFamily; > TCHAR lfFaceName[LF_FACESIZE]; <<<<<<<<<<<<<<<<<<<<<<<<<<<< >} LOGFONT,*LPLOGFONT; >The TCHAR type is defined as WCHAR if UNICODE is active, or to CHAR if we are >in ascii. This means that if I work in ascii, but want (for whatever reason) >use the wide types, it is impossible. > >The solution to this riddle is simple: we have to define BOTH structures, even >if the user has NOT defined UNICODE becuase he MAY want to use the wide >structures too. > >Since this would lead to an increased size in the already voluminous headers, >I propose to split the structures definitions in TWO files: one for the >ASCII structures, and the other for the UNICODE structures when applicable. >If the user wants to use the wide structures when NOT in UNICODE, he just >would include the other file: #include . In the same vein >if in UNICODE and wants to use the ASCII structure (passing arguments to >16 bit programs, whatever) he would #include . > >In any case, according to the UNICODE value, only one set of structures would >be used by default, so 99.99% of you that do not have this kind of weird >problems wouldn't be penalized... > > >-- >Jacob Navia Logiciels/Informatique >41 rue Maurice Ravel Tel 01 48.23.51.44 >93430 Villetaneuse Fax 01 48.23.95.39 >France >- >For help on using this list, send a message to >"gnu-win32-request AT cygnus DOT com" with one line of text: "help". > - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".