MFC - OpenFile in Notepad
yuibox March 18th, 2008 This is a simple example of how to Open a file in Notepad , using MFC C++

[source:c++]
void CTestContainerDlg::OnBnClickedButtonOpenFile()
{
char szPathStr [MAX_PATH];
::GetCurrentDirectory(MAX_PATH, szPathStr);
CString szFullPath = CString(szPathStr) + “\\” + szFileName;
ShellExecute(NULL, NULL,”notepad.exe”, szFullPath ,NULL,SW_SHOW);
}[/source]
[source:c++]ShellExecute(NULL, NULL,”explorer.exe”, szPathStr ,NULL,SW_SHOW); [/source]
Stumble it!
Recent Comments