Click here to Skip to main content
15,908,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralModeless Child Dialog Pin
Daishy8-Jul-03 8:00
Daishy8-Jul-03 8:00 
GeneralRe: Modeless Child Dialog Pin
Magnus Westin8-Jul-03 8:14
Magnus Westin8-Jul-03 8:14 
GeneralRe: Modeless Child Dialog Pin
Daishy10-Jul-03 3:38
Daishy10-Jul-03 3:38 
GeneralRecent File List (MRU) Pin
Rome Singh8-Jul-03 7:26
Rome Singh8-Jul-03 7:26 
GeneralRe: Recent File List (MRU) Pin
David Crow8-Jul-03 7:34
David Crow8-Jul-03 7:34 
GeneralRe: Recent File List (MRU) Pin
Rome Singh8-Jul-03 7:45
Rome Singh8-Jul-03 7:45 
QuestionEveryone has STUpload source code in MCSD C++ Kit? Pin
Anonymous8-Jul-03 7:06
Anonymous8-Jul-03 7:06 
GeneralGetOpenFileName thread problem Pin
Anonymous8-Jul-03 6:59
Anonymous8-Jul-03 6:59 
I have been trying all day to get a file open dialog box that would not give me any errors. I have tried the CFileDialog Box which looked like this:

CFileDialog *fileDlg = new CFileDialog(TRUE, "*.exe", NULL, OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST, "Executable files (*.exe)|*.exe||", GetActiveWindow());

// Initializes m_ofn structure
fileDlg->m_ofn.lpstrTitle = "Half-Life Executable Path";
// Call DoModal
if ( fileDlg->DoModal() == IDOK)
{
m_PATH.SetWindowText(fileDlg->GetPathName());
}
delete fileDlg;

I have also tried the windows api way (non mfc) (this is for a dll, i think i have to change the return type too):

char *Open_File(HWND m_hwnd)
{
OPENFILENAME ofn;
char szFileName[MAX_PATH];

ZeroMemory(&ofn, sizeof(ofn));
szFileName[0] = 0;

ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = m_hwnd; //handle to your window
ofn.lpstrFilter = "Half-Life Executable (*.exe)\0*.exe\0\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "exe";
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;

if(GetOpenFileName(&ofn))
return ofn.lpstrFile;
else
return "";
}

If I open the file dialog box and then click ok after selecting a file it will do this fine in the window:
m_PATH.SetWindowText(fileDlg->GetPathName());

I have a main window and an options screen. The options screen is in a modal state when I call the file dialog and the parent of the file dialog is the options screen. Now up to this stage it is all dandy because I can close the options screen then open the options screen again and it will display the previously selected file because I save it and load it into the text control. But when I close the program I get this:

he thread 0xF14 has exited with code 133 (0x85).
The thread 0xB88 has exited with code 133 (0x85).
The thread 0x4CC has exited with code 133 (0x85).
The thread 0x5B8 has exited with code 133 (0x85).
The program 'C:\Console Connector++\HLCC 0.5a\Debug\HLCC.exe' has exited with code 133 (0x85).

I ended up playing with it all and found out I only get this when I call GetOpenFileName. After using the file dialog I can no longer do file output. By the way im using VC++ 6.0 SP5.

Argghhhh!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! It is very urgent cause Im doing an update for my program that people use!!!
Thanks.

GeneralRe: GetOpenFileName thread problem Pin
Joaquín M López Muñoz8-Jul-03 7:08
Joaquín M López Muñoz8-Jul-03 7:08 
GeneralRe: GetOpenFileName thread problem Pin
John M. Drescher8-Jul-03 7:14
John M. Drescher8-Jul-03 7:14 
GeneralRe: GetOpenFileName thread problem Pin
Anonymous8-Jul-03 7:29
Anonymous8-Jul-03 7:29 
GeneralRe: GetOpenFileName thread problem Pin
David Crow8-Jul-03 7:24
David Crow8-Jul-03 7:24 
GeneralRe: GetOpenFileName thread problem Pin
Anonymous8-Jul-03 7:31
Anonymous8-Jul-03 7:31 
GeneralRe: GetOpenFileName thread problem Pin
David Crow8-Jul-03 7:38
David Crow8-Jul-03 7:38 
QuestionText Editor as a list control? Pin
Jay Hova8-Jul-03 6:36
Jay Hova8-Jul-03 6:36 
AnswerRe: Text Editor as a list control? Pin
Magnus Westin8-Jul-03 6:48
Magnus Westin8-Jul-03 6:48 
GeneralRe: Text Editor as a list control? Pin
Jay Hova8-Jul-03 7:53
Jay Hova8-Jul-03 7:53 
GeneralRe: Text Editor as a list control? Pin
Magnus Westin8-Jul-03 8:10
Magnus Westin8-Jul-03 8:10 
GeneralRe: Text Editor as a list control? Pin
Jay Hova8-Jul-03 8:54
Jay Hova8-Jul-03 8:54 
GeneralRe: Text Editor as a list control? Pin
David Crow8-Jul-03 9:33
David Crow8-Jul-03 9:33 
QuestionHow to unzip archive file in C/C++ Pin
Valera2411768-Jul-03 6:07
Valera2411768-Jul-03 6:07 
AnswerRe: How to unzip archive file in C/C++ Pin
Jon Sagara8-Jul-03 6:21
Jon Sagara8-Jul-03 6:21 
GeneralMysterious C++ behaviour Pin
RK_20008-Jul-03 6:01
RK_20008-Jul-03 6:01 
GeneralRe: Mysterious C++ behaviour Pin
Magnus Westin8-Jul-03 6:52
Magnus Westin8-Jul-03 6:52 
GeneralWM_KEYDOWN Events... Pin
Tintori Francesco8-Jul-03 5:09
Tintori Francesco8-Jul-03 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.