Hi, I'm in a bit of a conundrum: using QSettings results in a crash under Windows XP, MinGW, Qt 4.7.

Qt Code:
  1. #include <QtCore/QCoreApplication>
  2. #include <QtCore/QSettings>
  3.  
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QCoreApplication a(argc, argv);
  8.  
  9. QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, "C:/folder");
  10.  
  11. QSettings s("Org", "App");
  12. s.setValue("test", "value");
  13.  
  14. return a.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

This simple app throws an exception at line 9, ultimately pointing to some code in qsettings.cpp:

Qt Code:
  1. if (SHGetSpecialFolderPath) {
  2. wchar_t path[MAX_PATH];
  3. SHGetSpecialFolderPath(0, path, type, FALSE);
  4. result = QString::fromWCharArray(path);
  5. }
To copy to clipboard, switch view to plain text mode 

At other times, creating a pointer to a QSettings object in the header file and later initializing it results in the same exception:

Qt Code:
  1. // header of some class
  2. QSettings *mySettings;
  3.  
  4. ...
  5.  
  6. // constructor of class
  7. mySettings = new QSettings();
To copy to clipboard, switch view to plain text mode 


This doesn't happen on Windows, and the app runs fine when I don't use a debugger. I found a reported bug on http://bugreports.qt.nokia.com/brows...s:all-tabpanel but it doesn't seem to be verified.