|
david bagaturia wrote: can help?
Yes. Change that one thing to the other.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How we can help you when you cant say anything about your program!?
|
|
|
|
|
|
Hi,
I am using Visual Studio 2005 and Win 2k3 and I have made a command "del /S /Q /f c:\\testfolder", and want to execute it through CreateProcess, i get the error The system can't find the file specified i.e. "Del" exe, I usually use Del from command prompt, and in command prompt it works fine, any help regarding that.
Warm Regards,
Mushq
|
|
|
|
|
try:
system("del /S /Q /f c:\\testfolder");
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I couldn't understand from that, what is system, is it a command??
|
|
|
|
|
system() is a native function from the C runtime, but deprecated. as i said previously, you should prefer using ShellExecute() instead
|
|
|
|
|
toxcct wrote: system() is a native function from the C runtime, but deprecated
Uh! and who deprecates it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
it is not thread safe if i remember correctly...
|
|
|
|
|
toxcct wrote: it is not thread safe if i remember correctly...
hence it is not that bad...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: hence it is not that bad...
deprecated doesn't mean forbidden don't make me day what i didn't say
|
|
|
|
|
as bad doesn't mean evil . On the other hand, being forbidden would be irresistible, at least to me...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: and who deprecates it?
...it was me...
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
You! bad guy! (sorry can't resist...)
|
|
|
|
|
|
|
use ShellExecute() instead
|
|
|
|
|
system() is very antiquated, and CreateProcess() IMO shouldn't be used when an equivalent API exists. Why are you not using SHFileOperation() with FO_DELETE ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: system() is very antiquated,
Euclid's algo is ancient, someone finds out that it si useful though.
DavidCrow wrote: and CreateProcess() IMO shouldn't be used when an equivalent API exists
Why? Isn't CreateProcess that fancy?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
/////////////////////////////////////////
// try it
#include <iostream>
using namespace std;
int main()
{
// your coder here
// ...
system("del /S /Q /f c:\\testfolder");
// ...
// your coder here
// ...
return 0;
}
|
|
|
|
|
Another question would be: is
C:\Testfolder really a file, or is it a folder.
If I recall correctly (and it's been years since I looked) del will not delete folders - you would need to use rd instead (remove directory) and the folder would have to be empty. Of course you could empty the folder with
"del /S /Q /f c:\\testfolder\*.*"
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
The current program I'm working on has a requirement for the GUI and functionality code to be in seperate classes. So far I've managed to split this functionality up however I now need to add messaging into it so that when the user clicks a button on the GUI the functionality class is informed and performs the appropriate action.
I've found the following example on this site, http://www.codeproject.com/dialog/messagehandling3.asp, however it doesn't quite cover what I need.
Can anyone supply code snippets or links to articles which cover this?
cheers,
|
|
|
|
|
What do you need to do beyond calling a function/method in response to the appropriate window
messages?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
hi, thanks for your reply, I originally did put set/get methods in however I've now been told to completely seperate my functionality and gui classes so windows messaging seems to be one possibly solution to this (see my reply to my main question for a *hopefully* clearer explination)
Andy,
|
|
|
|
|
mcsherry wrote: I've now been told to completely seperate my functionality and gui classes
There's no way to completely separate them. You still have to make a call to the functionality
class method from the message handler so they are still tied to each other.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|