Message-ID: <366427DF.96FB9779@montana.com> Date: Tue, 01 Dec 1998 10:31:11 -0700 From: bowman X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: "djgpp AT delorie DOT com" Subject: RSXNTDJ and anonymous unions Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com There seems to be some rsxntdj traffic, so while I am thinking of it.. many Windows structures are defined using anonymous unions. For instance, typedef struct _PROPSHEETPAGE { DWORD dwSiae; DWORD dwFlags; HINSTANCE hInstance union { LPCTSTR pszTemplate; LPDLGTEMPLATE pResource; }; union { HICON hIcon; LPCTSTR pszIcon;\ }; ...... } PROPSHEETPAGE; Part of the patches to the sdk header files consists of adding u, u1, etc, so that the union has a name. Occasionlly, the header files will have macros to insert dummy union names. Most code imported from VC, or examples in many of the popular books, will read: PROPSHEETPAGE psp; psp.pszTemplate = "IDD_FOO"; Under djgpp, anonymous unions are not supported, and this will fail, with the error "structure has no member named pszTemplate" The solution is to go to /rsxntdj/include/mssdk, and 'grep PROPSHEETPAGE *.h' to locate the definition. Then you can determine what the name of the union in question is, and write, psp.u.pszTemplate = "IDD_FOO"; Note that with the original MS DUMMYUNIONNAME macros, there is no 'u1', just u, u2, and u3.