|
I can't figure out what you are really trying to do.
First thing I've noticed is that. you are mainly dealing with a hardcoded file name "program.exe" and passed argument value which is in argv[0]. But you are trying to delete a file which is in argv[1]. I doubt you are really intended to deal with that parameter.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Sarath. wrote: I can't figure out what you are really trying to do.
"My goal here is to copy the currently used file. Then start the new file and delete the old one."
I've already said that, i _know_ the code is wrong. Im asking for help in trying to fix it.
|
|
|
|
|
Sorry if I misinterpreted your question. Seems someone else already answered your question.
In addition you will have to use strcmp or any other string comparison routine to compare the strings...
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
dellthinker wrote: if(file == currentfile){
this will never be true, these two pointers are always different.
dellthinker wrote: Sleep(8000);
I like those out-of-the-blue numbers. Should I increase or decrease them when switching
to a faster CPU or another Windows version?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: I like those out-of-the-blue numbers. Should I increase or decrease them when switching
to a faster CPU or another Windows version?
5 for that.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->ßRÅhmmÃ<-·´¯`·.
|
|
|
|
|
<br />
char *file="program.exe";<br />
char *currentfile = argv[0];<br />
<br />
if(file == currentfile){ <br />
...<br />
In this case you're comparing to pointers -- not 2 strings. You must use a string comparison function to do it... strcmp?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
probably want it case-insensitive...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I've never had much luck on VC++ 6.0 copying a dialog resource cleanly.
Now I'm trying it with VC++ 2003. I'm trying to copy a dialog from one project to another with the intent of including the .cpp and .h files later on to save me some work but copy/paste does not do anything and drag and drop from one project to the other gives visual indicators during the drag as if it wants to do it, but nothing happens when I attempt the drop.
I'm probably just missing something very important and probably very obvious but I can't seem to get it to work.
Any ideas how to copy a dialog template from one project to the next without needing to dig into the .rc file directly?
|
|
|
|
|
I usually open the 2 RC files in NOTEPAD -- and copy dialogs by hand.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
So we really are stuck doing it by hand still. Not surprising but very odd for a nth generation "Visual" IDE.
Thanks for the feedback.
Does VC++ 2005 or 2008 handle copying or is it still by hand there as well?
(I never tried that with VC++ 2005 beta when I tested it back then.)
|
|
|
|
|
Hello everyone!
Here are my questions:
1) When drawing ellipses, rectangles, lines, et cetera, how do you select a color? I can't use SetDCPenColor() because they're not supported on Win9x/ME. And I'm on Win3.1.
2) How do you free memory from a HBITMAP?
Thanks in advance!
Windows Calculator told me I will die at 28.
|
|
|
|
|
Lord Kixdemp wrote: 1) When drawing ellipses, rectangles, lines, et cetera, how do you select a color?
Create a pen and a brush. Select them into the DC you're going to draw on.
The pen will be used for the outline, the brush for the interior.
Lord Kixdemp wrote: 2) How do you free memory from a HBITMAP?
DeleteObject()
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I dont know why you got vote 3?
|
|
|
|
|
Doesn't matter to me. If the OP needs more info then (s)he's free to ask.
Explaining all of the basics of GDI (which is well documented) here is kind
of beyond the scope of this forum.
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark replied my question in its entirety, I don't know why someone voted 3... I didn't even know there was a voting system until Hamid said that and I figured it out. o_O
*Is voting... takes some time*
Windows Calculator told me I will die at 28.
|
|
|
|
|
Yeah you can of 1 to 5 give to someone (like 5 to me )
|
|
|
|
|
Do you like, win something with high scores?
Windows Calculator told me I will die at 28.
|
|
|
|
|
For win we need to write a good article and submit it on the codeproject.(I told you because it's first time that you are using of vote so I was thinking you start with 5
Except it I like to ask a question of you whats the meaning of your Signature I saw it already?
|
|
|
|
|
|
Lord Kixdemp wrote: Good article? Hmm... I've got a great idea in mind.
Good luck.
Lord Kixdemp wrote: Coincidence or reality? Only destiny will know
I dont like think to it I am because I can think.;)
|
|
|
|
|
Hi,
How do I generate line number information in the MAP files for C++/VC++ projects? I am using Visual C++ 2005 and could not find any option to generate such information. VC++ 6.0 had an option for generating line number information in the MAP file. This option is present on C++ tab, Debug info drop-down in VC++ 6.0
Thanks and Regards.
|
|
|
|
|
It looks like the /MAPINFO:LINES linker option has been removed starting with VS 2005.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
May I ask what you need the MAP file for? Many people are under the mistaken impression that to debug a release build you need a MAP file, whereas in reality you can just enable debug information in your release build and use your debugger (almost) as per normal.
Steve
|
|
|
|
|
Every now and then when I am looking at crash dumps from the field.... if the debugger's not helping (using a PDB), sometimes the map has a clue.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Map files does have information at times which can be useful. More over I receive a screen shot from customers or beta testers which has just offset information. Using map files and line number information is sometimes easier to locate the crash location as discussed in some of the articles on this site.
|
|
|
|