|
Really? Unbelievable!
Maybe the problem is that I'm giving an input and an output filename as parameters?
If I do it at a command prompt with quotes, all works perfectly OK.
If I do it by using system - on exactly the same string, it does nothing.
I tried even moving the quotes to the directory with spaces, but it made no difference.
c:"a b c"\dcmdjpeg C:\ic2006\dicom\kressel\study1\ctseries\view0405.dcm c:"a b c"\jpegUncompress.dcm
I made a directory "a b c" just for test purposes. In this case I forgot the backslash "c:\a b c", but that isn't the problem.
Could you do me a favor and see if system works if you pass parameters?
For me it works fine so long as I don't both spaces in the path and spaces to separate parameters.
Thanks,
Ilan
|
|
|
|
|
Can you tell me which command are you trying to execute using the system?
|
|
|
|
|
It is an exe file which I received to decompress JPEG Dicom files.
I'm sure the problem exists for any command which has parameters on the command line.
Again it worked just fine until I tried using a path which included "Program Files".
Maybe I should try to run notepad with an input file and see if notepad opens the file.
I'll try something like ""c:\a b c\notepad" myfile.txt"
First I'll try c:\ilan\notepad myfile.txt, since that should work.
|
|
|
|
|
IlanTal wrote: I'll try something like ""c:\a b c\notepad" myfile.txt"
in this case you should specify like
system( "notepad.exe \"C:\\a b c\\myfile.txt"" );
note that \ " are all special character, when you want to insert a quote(") in a string u have to place a \ infront of it.
suppose you hard code "abcd" in the code and passed to the system, then the function will get abcd
you have to specify like "\"abcd\"" for the system() for it to get a string like "abcd"
|
|
|
|
|
Nave, thanks for all your kind help.
It has been very useful indeed!
Apparently it is a combination of system together with that particular exe I'm using.
The exe has to parse the command line to get the input and output files and it has a subtle bug.
All my experiments of using notepad worked fine. (I copied notepad into a b c for test purposes.)
On the other hand that exe fails using the system command.
If I take the buffer which I pass to system and copy it into a command box, all works fine!
I think it is time to use ShellExecute as you originally suggested.
The experiments have been fun, but the system command with that exe doing parsing don't seem to work.
Ilan
|
|
|
|
|
Nave,
I just wanted to let you know what a joy the ShellExecute is.
I used c:\a b c\ as the default directory and I separated out the command from the parameters.
In system it was all one big mess and the exe file got confused.
With ShellExecute everything works like a charm.
Thanks again for your generous help,
Ilan
|
|
|
|
|
IlanTal wrote: Thanks again for your generous help,
You are welcome.
|
|
|
|
|
I've run into a new problem.
ShellExecute launches the program and then returns.
I need the results of the program so I need to know when the program is finished.
It turns out that system() returns only after the program has finished.
Is there any obvious way to know the program has finished?
Thanks,
Ilan
|
|
|
|
|
in that case use the ShellExecuteEx() function. in that function you will get the handle of the new process. so after calling the ShellExecuteEx() function wait for the handle using the WaitForSingleObject() function.
|
|
|
|
|
Once again, thanks for your help.
When I ran things under the debugger, I looked at the directories, saw what files there were, saw how they were created, and I was happy that everything was working.
When I let it go, I realized I still had a problem.
Your help has been extremely useful.
Ilan
|
|
|
|
|
My application is up and running at full speed.
Thanks again,
Ilan
|
|
|
|
|
IlanTal wrote: My application is up and running at full speed.
congrads
|
|
|
|
|
your problem is because the \ character is understood as the escapment character, so, to "output" a \, you must type '\\' :
buff = "c:\\Program Files\\myDir\\myProg"
BTW, prefer avoid using the ::system() CRT function because it is not totaly safe.
use it ::Shellexecute() or ::CreateProcess() instead.
|
|
|
|
|
Hi all,
Can anybody please tell me the difference between debug-build and release build....
thanks in advance
|
|
|
|
|
haacked.com/archive/2004/02/14/difference-between-debug-vs-release-build.aspx
http://www.codeguru.com/forum/archive/index.php/t-269905.html
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Debug and Release are for building your project with different configurations.Sometimes you use of Debug mode for debugging your project while Release mode is final build of your program for users.Debug mode contain additional data and symbols to aid debugging but Relase mode optimizations your code without extra debug data.
|
|
|
|
|
See here[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
For example you can use the DEBUG mode to check manually if the code is correctly working, to do this you can use some useful macros as ASSERT () or TRACE ().
During compile of the RELEASE version that lines are jumped.
Russell
|
|
|
|
|
In debug mode, most optimizations are turned off
In debug mode, Str Library allocates more memory than strictly needed and attempts to detect buffer overwrite and stray pointer issues
In debug mode, when thread safety is also enabled, Str Library makes sure that for non-MT-marked objects, only the creator thread attempts modify operations
In debug mode, several unusual conditions that represent programming errors are checked in the code and an ASSERT-ion is thrown if a bad state is detected.
|
|
|
|
|
Is it possible for me to create text-to-speech application for my own language(right to left).
plz help me out the basic steps.
|
|
|
|
|
yah sure,
long back, i have seen somebody using such active X control in vb. i will also try it out.
|
|
|
|
|
Why not?
The 'right to left' mode is only related to the draw function of the control where you put/get the strings.
Then simply you have only to give the strings to the TTS-dll.
Russell
|
|
|
|
|
TanX for reppling!
Sir!
can u tell me wether i'll need phonetic transcription or not.
if yes then plz guide me.
|
|
|
|
|
Sorry, I haven't used TTS before for that problem.
A good example to how start to use the APIs is this[^], and in this site you can find many other example; try to see if someone has developed something for the 'right to left' lenguages.
good luck;)
Russell
|
|
|
|
|
I have some list view that i hold in it item.
I want to change the space between the items in the table and the text - in some cases i want to change it to be with bigger space and in some cases i want to change it to be with no space at all.
How to do it ?
Thanks.
|
|
|
|