Click here to Skip to main content
15,910,878 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CEdit help Pin
Stephen McGeown12-Aug-01 2:37
Stephen McGeown12-Aug-01 2:37 
GeneralATL hell - import object to MFC project part III Pin
Christian Graus11-Aug-01 18:30
protectorChristian Graus11-Aug-01 18:30 
GeneralRe: ATL hell - import object to MFC project part III Pin
11-Aug-01 21:07
suss11-Aug-01 21:07 
GeneralCWnd::MoveWindow(...) in CScrollView doesn't work Pin
Craig Miller11-Aug-01 18:16
Craig Miller11-Aug-01 18:16 
GeneralSelf Extracting Exe Pin
sankar11-Aug-01 15:42
sankar11-Aug-01 15:42 
GeneralMFC SDI application: opening documents Pin
11-Aug-01 9:37
suss11-Aug-01 9:37 
GeneralRe: MFC SDI application: opening documents Pin
12-Aug-01 6:40
suss12-Aug-01 6:40 
GeneralRe: MFC SDI application: opening documents Pin
Stephen McGeown12-Aug-01 11:16
Stephen McGeown12-Aug-01 11:16 
OK!

In your new app, go to the class wizard, select the object ID called "ID_FILE_OPEN". Then click on the COMMAND text in the box marked "Messages". Next, click "Add function" and it'll prompt you to name the function - probably "OnFileOpen".

It will generate a member function called OnFileOpen() somewhere in your code, probably as part of your mainframe class. So, you find your OnFileOpen() function, which will be empty except for some comments like "Add your command handler code here".

Add some code like this to your OnFileOpen() function:

{
CString strFilter;
CString path;
FILE *myfile;

CFileDialog MyFileDialog(TRUE,
"*.txt",
NULL,
NULL,
"Text file (*.txt)|*.txt" );

/* Display the File Dialog box */
int result = MyFileDialog.DoModal();

/* Return the path (including filename) */
path = MyFileDialog.GetPathName();

/* Open it up */
myfile = fopen(path, "r");
/* etc...*/
}

Haven't tested this out but it might be worth a bash. As for your second question, no idea but I've noticed that the behaviour differs between Win9x and Win NT.

Hope it helps. Cheers.

Generalchange tabstop Pin
11-Aug-01 9:09
suss11-Aug-01 9:09 
GeneralRe: change tabstop Pin
11-Aug-01 9:39
suss11-Aug-01 9:39 
GeneralRe: change tabstop Pin
11-Aug-01 12:16
suss11-Aug-01 12:16 
GeneralCustom Draw in CListView Pin
11-Aug-01 7:52
suss11-Aug-01 7:52 
GeneralRe: Custom Draw in CListView Pin
Michael Dunn11-Aug-01 7:55
sitebuilderMichael Dunn11-Aug-01 7:55 
GeneralRe: Custom Draw in CListView Pin
11-Aug-01 8:02
suss11-Aug-01 8:02 
GeneralRe: Custom Draw in CListView Pin
11-Aug-01 8:09
suss11-Aug-01 8:09 
QuestionHow to search for multiple file types? Pin
James Spibey11-Aug-01 5:44
James Spibey11-Aug-01 5:44 
QuestionHow can I do to know how datas is in my serial buffer when I use CreateFile ? Pin
youssef11-Aug-01 5:36
youssef11-Aug-01 5:36 
AnswerRe: How can I do to know how datas is in my serial buffer when I use CreateFile ? Pin
Tim Deveaux11-Aug-01 7:32
Tim Deveaux11-Aug-01 7:32 
GeneralRe: How can I do to know how datas is in my serial buffer when I use CreateFile ? Pin
youssef11-Aug-01 23:28
youssef11-Aug-01 23:28 
GeneralList control in LVS_REPORT doesn't show all my columns Pin
Wim Jans11-Aug-01 5:10
Wim Jans11-Aug-01 5:10 
GeneralRe: List control in LVS_REPORT doesn't show all my columns Pin
Wim Jans11-Aug-01 5:12
Wim Jans11-Aug-01 5:12 
GeneralRe: List control in LVS_REPORT doesn't show all my columns Pin
Michael Dunn11-Aug-01 7:58
sitebuilderMichael Dunn11-Aug-01 7:58 
GeneralRe: List control in LVS_REPORT doesn't show all my columns Pin
Wim Jans11-Aug-01 8:03
Wim Jans11-Aug-01 8:03 
GeneralWriting to /extending the middle of a binary file Pin
11-Aug-01 3:54
suss11-Aug-01 3:54 
GeneralRe: Writing to /extending the middle of a binary file Pin
12-Aug-01 6:43
suss12-Aug-01 6:43 

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.