Click here to Skip to main content
15,917,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralShell extension query (I think) Pin
Nish Nishant9-Sep-02 0:09
sitebuilderNish Nishant9-Sep-02 0:09 
GeneralRe: Shell extension query (I think) Pin
Andreas Saurwein9-Sep-02 2:10
Andreas Saurwein9-Sep-02 2:10 
GeneralRe: Shell extension query (I think) Pin
Nish Nishant9-Sep-02 4:46
sitebuilderNish Nishant9-Sep-02 4:46 
GeneralRe: Shell extension query (I think) Pin
Roger Stewart9-Sep-02 6:20
professionalRoger Stewart9-Sep-02 6:20 
GeneralWinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
Qadddd9-Sep-02 0:07
Qadddd9-Sep-02 0:07 
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
adamUK9-Sep-02 1:21
adamUK9-Sep-02 1:21 
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
Qadddd9-Sep-02 2:45
Qadddd9-Sep-02 2:45 
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
adamUK9-Sep-02 9:31
adamUK9-Sep-02 9:31 
DD,

Are you opening the file with just CFile::modeCreate? I have just put together an app to try to recreate your problem on VC6. Everything works just fine but you can't write to your file if you open in CFile::modeCreate only. It has to be CFile::modeCreate+CFile::modeWrite.

e.g.

CStdioFile file;<br />
file.Open("c:\\filetest.txt", CFile::modeCreate+CFile::modeWrite+CFile::shareExclusive,NULL);<br />
file.SeekToEnd();<br />
file.WriteString("this is written\n");<br />
file.Close();<br />
WinExec("c:\\WINNT\\notepad.exe c:\\FileTest.txt",SW_SHOW);


works fine and dandy.

CStdioFile file;<br />
file.Open("c:\\filetest.txt",CFile::modeCreate+CFile::shareExclusive,NULL);<br />
file.SeekToEnd();<br />
file.WriteString("this is written\n");<br />
file.Close();<br />
WinExec("c:\\WINNT\\notepad.exe c:\\FileTest.txt",SW_SHOW);

fails at WriteString() and never gets to WinExec.

If you post the code that's causing you a prob then perhaps we could have a look?

hope this helps


Adam.

P.S. would recommend using ShellExecuteEx rather than WinExec as you can get a handle to Notepad to see when it has terminated.

"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
Carlos Antollini9-Sep-02 9:38
Carlos Antollini9-Sep-02 9:38 
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
adamUK9-Sep-02 9:45
adamUK9-Sep-02 9:45 
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
Qadddd10-Sep-02 7:53
Qadddd10-Sep-02 7:53 
GeneralRe: WinExec("Notepad.exe " +fileName,SW_SHOW doesn't work ) Pin
adamUK10-Sep-02 11:29
adamUK10-Sep-02 11:29 
GeneralInstallation tool Pin
Anthony B.8-Sep-02 23:21
Anthony B.8-Sep-02 23:21 
GeneralRe: Installation tool Pin
[James Pullicino]8-Sep-02 23:35
[James Pullicino]8-Sep-02 23:35 
GeneralRe: Installation tool Pin
Jon Taylor8-Sep-02 23:38
Jon Taylor8-Sep-02 23:38 
GeneralRe: Installation tool Pin
Jawache9-Sep-02 0:08
Jawache9-Sep-02 0:08 
GeneralRe: Installation tool Pin
Alwin759-Sep-02 5:44
Alwin759-Sep-02 5:44 
GeneralFTP problem Pin
veeran8-Sep-02 23:13
veeran8-Sep-02 23:13 
GeneralRe: FTP problem Pin
Renjith Ramachandran8-Sep-02 23:51
Renjith Ramachandran8-Sep-02 23:51 
Generalhelp socket Pin
yuke8-Sep-02 23:00
yuke8-Sep-02 23:00 
GeneralRe: help socket Pin
yuke9-Sep-02 0:22
yuke9-Sep-02 0:22 
Questionhow to close the 1st mediaplayer object when opening a second ? Pin
DengJW8-Sep-02 22:38
DengJW8-Sep-02 22:38 
AnswerRe: how to close the 1st mediaplayer object when opening a second ? Pin
Rickard Andersson208-Sep-02 23:09
Rickard Andersson208-Sep-02 23:09 
GeneralRe: how to close the 1st mediaplayer object when opening a second ? Pin
DengJW8-Sep-02 23:29
DengJW8-Sep-02 23:29 
QuestionHow to map pixels to dialog unit Pin
Anonymous8-Sep-02 21:39
Anonymous8-Sep-02 21:39 

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.