Article View: borland.public.cppbuilder.nativeapi
Article #16770Re: GetOpenFileName problem
From: Ed Mulroy [TeamB]
Date: Tue, 29 Apr 2003 03:20
Date: Tue, 29 Apr 2003 03:20
39 lines
2581 bytes
2581 bytes
Files built for Win 98SE and below will show a smaller size for the OPENFILENAME structure. For instance on my XP machine the size is 88 bytes and the OpenFileName call works well. It doesn't work on my wife's Win98SE machine because it uses the style and size of that structure consistent with later versions of Windows. So put these in the Defines box as a macro: _WIN32_WINNT=0x400 WINVER=0x400 That should change it from the 0x500 that it defaults to and should cause the Windows header files to expand with the older, smaller size for the structure. When the GetOpenFileName structure sees the smaller size in the newer Windows versions it should know how to handle it and the old versions only know how to work with the older size. For when you use the command line tools add these lines to the end of the bcc32.cfg file that is in the compiler's BIN directory. -D_WIN32_WINNT=0x400 -DWINVER=0x400 Borland C++ 5.02 is from 1997 so is too old to reflect the changes in Windows 2000 and beyond. . Ed > John Berg wrote in message > news:3eade901$1@newsgroups.borland.com... > > I'm building a pure API application with C++ Builder6. The > 'sizeof' function returns a value of 88 bytes for the > OPENFILENAME structure, which causes a > CDERR_STRUCTSIZE error and prevents the Open > common dialog box from appearing. Apparently the correct > size is 76 bytes. When this is coded directly into lStructSize > the dialog box appears just fine. Same code under Borland > C++ 5.02 works OK, as 'sizeof' returns the value of 76. What's > wrong with Builder6?
Technical Details
Message-ID:
<3eadef87@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3eade901$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,5577b493e5ad6bb9 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-28 20:27:49 PST From: "Ed Mulroy [TeamB]" <ed@mulroyREMOVETHESECHARS.org> Newsgroups: borland.public.cppbuilder.nativeapi References: <3eade901$1@newsgroups.borland.com> Subject: Re: GetOpenFileName problem Date: Mon, 28 Apr 2003 23:20:21 -0400 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 206.228.162.62 Message-ID: <3eadef87@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1051586439 206.228.162.62 (28 Apr 2003 20:20:39 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail