How can i open a file in notepad from MFC dialog based application:confused:
How can i open a file in notepad from MFC dialog based application:confused:
Hi Sir,
Try the following code:
CString strFile;
strFile = "c:\\temp\\readme.txt";
ShellExecute(NULL,
"open",
strFile,
NULL,NULL,
SW_SHOW);
Andy
--------------------------------------------------------
http://www.********.net
XD++ MFC Library provides Microsoft Foundation Class (MFC)/Visual C++ developers with a complete library of MFC extension classes which implement a drag and drop (e.g. VC,VB Form Editor) graphical interface.
Hope this will help you.Code:ShellExecute(NULL, "open", "NOTEPAD MYTEXT.TXT", NULL, NULL, SW_SHOW);
thanks for the reply but
it doesnt display the notepad with file:confused:
Take a look at this FAQ...
Try using:
Where 'MYTEXT.TXT" is agument to notepad. You may need to pass full path of the file.Code:ShellExecute(NULL, "open", "NOTEPAD","MYTEXT.TXT", NULL, SW_SHOW);
thanx it worked:)