I understand how important internationalization is etc. But I really need some way to convert the QString returned by getOpenFileName to a char* so I can call this function from this library I'm using.

I'm guessing that the way I'm converting the string is incorrect because the "not a map" about box triggers. However I don't know of any function that will echo back a char* C style string to me.

I tried including windows.h and saying: MessageBox(NULL, "A NORMAL STRING DAMINT", "MESSAGE", MB_OK); the way I used to do things when I coded in C. But I get "cannot convert const char* to const WCHAR*"

What the hell is a WCHAR???

Qt Code:
  1. void MainWindow::open() {
  2. MPQHANDLE *MPQarchive;
  3.  
  4. QString FileString = QFileDialog::getOpenFileName(this, tr("Open File"), "/",
  5. tr("Starcraft maps (*.scm *.scx *.chk);;All Files (*.*)"));
  6. if(FileString.endsWith(".scm") || FileString.endsWith(".scx")) {
  7. if(!SFileOpenArchive((char*)FileString.data(), 1, 0, MPQarchive)) {
  8. QMessageBox::about(this, tr("Not a map?"), FileString);
  9. }
  10. }
  11. }
To copy to clipboard, switch view to plain text mode