Re: Problems with GetOpenFileName and GetSaveFileName
- From: "Leslie Milburn" <CDB4W@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Jun 2005 22:13:00 +1000
Hi James,
Thanks for your efforts. Answers inline......
"James Brown" <remove_james_dot_brown7_at_virgin_dot_net> wrote in message
news:429d66e5$0$290$cc9e4d1f@xxxxxxxxxxxxxxxxxxxxxx
>
> OK I've tested your program with VC6 SP6. I made myself a little
> resource file with a simple Dialog in it. I also didn't use your makefile
+
> compiled straight using VC workspace.
>
> Couple of comments:
>
> BOOL CALLBACK EXPORT MainWndProc(HWND, UINT, WPARAM, LPARAM);
>
> I don't know what EXPORT means in this context. I had to remove it from
the
> declaration
Actually in this context EXPORT is nothing as in
#define EXPORT
The reason being is that this code was actually migrated years ago from
16bit and so theres a lot of legacy defines going on around the place.
> int WinMain(HINSTANCE hInst, // Application Instance Handle
> HINSTANCE hPrevInstance, // Previous Instance Handle
> LPSTR lpszCmdLine, // Pointer to Command Line
> int nCmdShow) // Show Window Option
>
> You are missing one important detail here:
>
> int WINAPI WinMain
Actually, thats a typo !!
> Anyhow I ran your program and it seemed OK - I got "User Pressed OK",
"User
> Pressed Cancel"
> messages and no crashes...
Which is what I get as well on my four different machines.
> I have copied a ZIP up to my website which contains the binary+sources for
> your program, compiled with VC6 for you to test:
>
> www.catch22.net/source/zips/ofn_test.zip
Thanks I will download it and give it a whirl.
> Maybe try a different compiler? Or the latest service-pack for VC5?
> Try compiling with maximum warning level to make sure there isn't
something
> subtle tripping you up..
>
> There may be a way to work around the problem by specifying more options
> rather than less....
>
> Also, what version of the Platform SDK are you using? Make sure your
version
> and it's headers are all up-to-date.
I am using Visual Studio 97 for this application. The SDK is old but I still
have users using Win95 for some applications (yeah I know - cheapskates - I
even offered them free upgrades to 98SE but they didn't go for it). Anyway
thats why I haven't upgraded as yet.
> What is _WIN32_WINNT #defined as before you #include <windows> and
> <commctrl> ??
> Try:
>
> #define _WIN32_WINNT 0x500
> #include <windows.h> etc
I looked into that I don't have OFN_NT4 (or whatever it is) in my headers
and will need to change the SDK. If I can definitely identify my development
environment as the problem then I'll change it, but I have to be sure first
before I resort to that. Your program will help out here because if it
crashes then I know its not me and if it doesn't then I know it is :-)
> This will give you different versions of the OPENFILENAME structure, with
> extra fields so the structure will be different. It will still work under
9x/NT4 etc but
> could potentially be the source of the problem. But you need recent (i.e.
Feb 2003+) platform
> SDK installed and available to the VC compiler..
I have downloaded that SDK but I am not sure if it is compatible with VC5,
so I might even upgrade to VC6, just to make sure I keep current ;-)
> You can email me via my website (www.catch22.net) - I'm on UK time so will
> not be able to help until this evening.
> GetOpenFileName crashes are very difficult to track down -
Once again thanks for your time on this problem. I'll let you know tomorrow
how your program fared !! I will also do the same thing and ignore my
makefile and do it via the IDE as well (which i detest - I still use Brief
and the command line).
Leslie.
.
- Follow-Ups:
- Re: Problems with GetOpenFileName and GetSaveFileName
- From: Leslie Milburn
- Re: Problems with GetOpenFileName and GetSaveFileName
- References:
- Re: Problems with GetOpenFileName and GetSaveFileName
- From: Leslie Milburn
- Re: Problems with GetOpenFileName and GetSaveFileName
- From: James Brown
- Re: Problems with GetOpenFileName and GetSaveFileName
- Prev by Date: Re: Problems with GetOpenFileName and GetSaveFileName
- Next by Date: Re: Problems with GetOpenFileName and GetSaveFileName
- Previous by thread: Re: Problems with GetOpenFileName and GetSaveFileName
- Next by thread: Re: Problems with GetOpenFileName and GetSaveFileName
- Index(es):
Relevant Pages
|