|
Hi !
Sorry, this is not really a C++ question, but, for my application, I need to create a batch file which would perform something on all cpp files in my current directory.
I would have to do something like this :
DoSomething filename.cpp filename.usf
Where DoSomething is a command which will take the given cpp file and generate a usf file with the same name as the cpp file (only the extension will change).
How can I do a batch to automatically do this on all cpp files (*.cpp) ?
Thank you for your help !
Jerome
|
|
|
|
|
FILE1.BAT:
for %%x in (*.cpp) do FILE2.BAT %%x
FILE2.BAT
DoSomething %1
Or if you just want one file:
FILE1.BAT:
for %%x in (*.cpp) do call :DO_IT %%x
exit
:DO_IT
DoSomething %1
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
For batch files that need to manipulate filenames like that, I use 4DOS/4NT[^] - writing batch files with it is way easier.
cdd "%1"<br />
for /a:-d %a in (*.cpp) DoSomething "%a" "%@name[%a].usf"
Run it with the directory name as the parameter
--Mike--
Personal stuff:: Ericahist Updated Feb 6! | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Michael Dunn wrote:
--Mike--
Personal stuff:: Ericahist Updated Feb 6! | Homepage
who is the woman in the link ericahist????sure she is pretty
is she ur wife/gf???? Hope you dont mind asking that question.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
|
Oh ok. I dont get .NET show here in India.
Last time I was sober, man I felt bad
Worst hangover that I ever had
It took six hamburgers and scotch all night
Nicotine for breakfast just to put me right.... Dire Straits
|
|
|
|
|
You know the ones used for tree controls???
Are they just 16x16 icons? Can I get those icons from the system tray or do I have to add my own icons?
thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
They are 16x16 bitmaps. Windows does not provide a standard set that you can use from memory so you need to supply your own. On XP you may be able to use the Theme functions to get it to draw them for you.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hi,
I am trying some code similar to what I have posted below, but it is not being compiled on the VC++ 7.0 and on VC++ 6.0 it gives a INTERNAL_COMPILER_ERROR :
#include <list>
...
template <class clDataType>
class CMyData
{
clDataType myObj;
unsigned long myObjSize;
public:
...
};
template <class clDataType>
class CMyManager
{
unsigned int nIndex;
clDataType myData;
list<CMyData<clDataType>> myList;
public:
...
};
What I am trying is to have a STL list of CMyData<clDataType>!
Is it possible or am I doing some mistake?!
Thanks,
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Your problem is this line:
list<CMyData<clDataType>> myList;
due to the lexical analysis of C++ it has to be written as this:
list<CMyData<clDataType> > myList;
as such the space is crucial. The >> is parsed as right-shift, even though it makes little sense in that context (also is why it causes an error).
Hope that helps.
--
Henrik Stuart (http://www.unprompted.com/hstuart/)
|
|
|
|
|
Hello Henrik,
It worked!... Thanks a ton! ... Well pointed out!
So much about Micro$oft Compiler!
Thanks,
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Hey,
You're welcome. It isn't, however, limited to Microsoft's compiler, it's mandated in ISO/IEC 14882:1998 and as such part of C++ as a language. You would get the same behaviour in any other C++ compiler.
--
Henrik Stuart (http://www.unprompted.com/hstuart/)
|
|
|
|
|
Oh, is it?!
My apologies to Bill Gate$ & Micro$oft!
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Don't apologize. The VC should report this as a parse error, not internal compiler error!
Robert-Antonio
Love, truth and electric traction must gain victory over hate, lie
and diesel traction.
|
|
|
|
|
Hello everybody, well i've got a question Visual C++ concerning creating a windows application instead of console application, and sorry if it's a silly question since i'm used to work on console applications only. So please can u show me the steps and the required syntax for creating this windows application ?
Thanks for your help .
|
|
|
|
|
with visual studio, create a new project "MFC AppWizard exe" and continue from there, you have 3 choices, SDI, MDI or dialog based; this will generate the basic skeleton for an application.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I highly recommend these books on windows programming using C++. Make sure you read them in this exact order.
MFC:
Introduction to MFC Programming with Visual C++ by Richard M. Jones
Programming Windows With MFC by Jeff Prosise
Win32 API:
Programming Windows by Charles Petzold
Kuphryn
|
|
|
|
|
Am trying to get Jeffrey's LastMesaageBox example hooking software working on XP using Microsoft Development Studio .NET. I keep getting an error that the stack is overflowing just when the message box is being displayed. Anyone have any ideas?
|
|
|
|
|
Debug it. Where is the error linked to?
Kuphryn
|
|
|
|
|
It says "Unhandled exception at 0x10011669 in 22 LastMsgBoxInfo.exe: 0xC00000FD: Stack overflow." It then says "There is no source code available for the current location." so I look at the Disassembled version and can't figure out what's going on. Any way of looking at assembler code to debug?Hope you can help.
|
|
|
|
|
Most likely you are doing infinite recursion which is very easy to do with hooks...
John
|
|
|
|
|
Thought so, the stack was full of repeated function calls. Can't see why this is happening though, how come it is easy to do with hooks? Any way of preventing this? Thanks.
|
|
|
|
|
if you do the wrong thing you can end up calling yourself by passing the hook on to the next hook in the list. Try commenting out the CallNextHookEx part and see if it crashes again...
John
|
|
|
|
|
how to hide the nasty dash rectangular boder when you drag window especially you have a special region as your window shape.
|
|
|
|
|
This only occurs when the user has unchecked "show window contents while dragging" in the display applet in control panel.
You could use SystemParametersInfo() with the action of SPI_GETDRAGFULLWINDOWS to query the current value and set it to true just prior to dragging your window. Once the drag is complete, you can call SystemParametersInfo() again to restore SPI_GETDRAGFULLWINDOWS to the original value.
Seems like a lot of work and code purely for asthetics... I'd verify the requirement, twice.
onwards and upwards...
|
|
|
|