Hi guys, I'm wondering if anyone can help me with a ShellExecute() problem.... I've alredy looked in a bunch of other Threads and still didn't got what I'm looking for....
Basicly, my program asks for a input and a output file, copys a bunch of stuff from the input file to the output file and opens the output file in Notepad.
The copy from the input file to the output file is working OK, but when I try to open the output file with ShellExecute, I get an empty file, although that if I try to open it trhu notepad i see the file is not empty......
Below the code I'm using
void CANSIDecoderDlg::OnSelectOutput()
{
CFileDialog m_ldFile(TRUE);
if (m_ldFile.DoModal() == IDOK)
{
m_Destination_File = m_ldFile.GetPathName();
UpdateData(FALSE);
}
}
void CANSIDecoderDlg::OnDecode()
{
.
.
.
if( (Buffer =fopen(m_Destination_File, "w" )) == NULL )
MessageBox("Destination File Not Found");
else
{
.
.
.
write a bunch of stuff in destination file
.
.
.
}
UpdateData(FALSE);
ShellExecute(NULL,
"open",
m_Destination_File,
NULL,
NULL,
SW_SHOWNORMAL);
}