PDA

View Full Version : getSaveFileName and getOpenFileName Crash



pmohod
19th April 2010, 15:57
Hello all,
I am developing an application on Qt-4.6.2 on window platform.
I am using windows XP professional version 2002 with SP3.




struct {
char Dir[_MAX_PATH];
char Filter[128];
} Param;

strcpy (Param.Dir, ".");
strcpy (Param.Filter, "*");

QString f = Q3FileDialog::getSaveFileName (Param.Dir, Param.Filter, 0, 0, Title); // crash



Here the application is crashing on the last line of code.

Here are some of my observations:

1) QString f = Q3FileDialog::getSaveFileName ("", Param.Filter, 0, 0, Title);
-- OK Works fine

2) QString f = Q3FileDialog::getSaveFileName (" ", Param.Filter, 0, 0, Title);
-- Crash

3) QString f = Q3FileDialog::getSaveFileName ("C:\\", Param.Filter, 0, 0, Title);
-- Crash

Interestingly when I tried the same application with same dlls on my colleague's machine, it is working fine with all options(mentioned above 1,2,3) .

The similar situation arise with Q3FileDialog::getOpenFileName() function also.

Please provide me any help regarding this issue.









it works fine.

TheJim01
19th April 2010, 18:57
Is your entire application in Qt 4.6.2? If so, please consider using QFileDialog instead of Q3FileDialog, which is only provided to keep old Qt3 code working.

pmohod
20th April 2010, 09:47
Is your entire application in Qt 4.6.2? If so, please consider using QFileDialog instead of Q3FileDialog, which is only provided to keep old Qt3 code working.

Thanks TheJim01,
After replacing Q3FileDialog with QFileDialog, it is working fine.
Thanks once again for prompt reply.