MS C++ 7.1 und GetOpenFileName
-
Hallo.
Ich habe mit MS C++ 6.0 diese Funktion verwendet, um den "Datei öffnen" Dialog anzuzeigen:
OPENFILENAME ofn; char szFile[260]; CWnd *mainWnd = AfxGetMainWnd(); // Initialize OPENFILENAME memset(szFile,0,sizeof(szFile)); ZeroMemory(&ofn, sizeof(OPENFILENAME)); ofn.lStructSize = sizeof(OPENFILENAME); ofn.hwndOwner = mainWnd->m_hWnd; ofn.lpstrFile = szFile; ofn.nMaxFile = sizeof(szFile); ofn.lpstrFilter = "All (*.*)\0*.*\0\0"; ofn.nFilterIndex = 1; ofn.lpstrFileTitle = NULL; ofn.nMaxFileTitle = 0; ofn.lpstrInitialDir = NULL; ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; // Display the Open dialog box. if (::GetOpenFileName(&ofn)==TRUE) { //Put File via Bluetooth SetFTPState(FTP_BUSY); WCHAR *p_s_wide = (WCHAR *)malloc (2*strlen(ofn.lpstrFile)+2); mbstowcs(p_s_wide, ofn.lpstrFile, strlen(ofn.lpstrFile)+1); PutFile(p_s_wide); free (p_s_wide); }
Jetzt soll das ganze Ding auf einmal auf C++ 7.1 laufen.
Problem:
Projekt geöffnet, erstellt -> geht.
Das einzige Problem ist dieser öffnen Dialog.
Es erscheint zwar kein Fehler beim Erstellen (auch keine Warnung) aber wenn man auf den Button drückt, passiert einfach gar nix... ?Braucht man für MS C++ 7.1 etwas anderes, oder warum tut das nicht?
Danke schon mal.
mfg
DanielEdit:
Ach Mist, falsches Forum erwischt
Sorry!
-
Dieser Thread wurde von Moderator/in HumeSikkins aus dem Forum C++ in das Forum MFC (Visual C++) verschoben.
Im Zweifelsfall bitte auch folgende Hinweise beachten:
C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?Dieses Posting wurde automatisch erzeugt.
-
Welcher Button?
Hast Du es schon mal mit "debuggen" probiert?
Was liefert "CommDlgExtendedError"?