|
-
August 26th, 2008, 10:28 PM
#16
Re: Need a simple program!
 Originally Posted by Xeon
C:\Documents and Settings\Xeon > cd C:\Documents and Settings\ops-Xeon\Desktop\VidsFolder
Xeon... Does your computer really have the TWO folder paths
C:\Documents and Settings\Xeon
and
C:\Documents and Settings\ops-Xeon\Desktop\VidsFolder
as you show from your post?
Is it possible that you want to navigate to
C:\Documents and Settings\Xeon\Desktop\VidsFolder
instead?
-
August 26th, 2008, 11:07 PM
#17
Re: Need a simple program!
I would say this is the prompt:
C:\Documents and Settings\Xeon >
And this is the response:
cd C:\Documents and Settings\ops-Xeon\Desktop\VidsFolder
He is changing directory via cd.
-
August 26th, 2008, 11:22 PM
#18
Re: Need a simple program!
No, my prompt doesn't have two folder paths, I'm just trying to cd from there, as what Bitshifter above says.
Anyway, I'll try again tonight, and if I can't, I will start hunting around for my VC++ CD since coding the thing from scratch is easier than this......this insanity!!!!! %((&*&$!
"Hell is calling for you!" - Rufus, from Valkyrie Profile 2 : Silmeria
"I'm getting tired of you devils.....finishing strike......Final Blast!" - Arngrim, from Valkyrie Profile 2 : Silmeria
-
August 26th, 2008, 11:29 PM
#19
Re: Need a simple program!
Xeon,
At the command prompt, type cd .. (to back up 1 level), then type dir - Like this:
Code:
C:\Documents and Settings\Xeon >cd ..
Code:
C:\Documents and Settings\ >dir
Post the list of directories that show up when you have done that.
-
August 27th, 2008, 12:20 AM
#20
Re: Need a simple program!
Heh Xeon, good to hear from you again. Pretty funny that you are having trouble with the command line, but then the windows command line leaves a lot to be desired.
Last edited by souldog; August 27th, 2008 at 01:22 AM.
Wakeup in the morning and kick the day in the teeth!! Or something like that.
"i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."
-
August 27th, 2008, 12:48 AM
#21
Re: Need a simple program!
Code:
void iterateFolder()
{
WIN32_FIND_DATA fileInfo;
lstrcat(rootPath,_T("\\*.*")); // where rootPath is the path to folder, use SHBrowseForFolder() to get path to folder.
HANDLE fileHandle = FindFirstFile(rootPath,(LPWIN32_FIND_DATA)&fileInfo);
if(fileHandle != INVALID_HANDLE_VALUE)
{
while(FindNextFile(fileHandle,(LPWIN32_FIND_DATA)&fileInfo))
{
//here you will get the filenames in fileInfo.cFileName
}
}
FindClose(fileHandle);
}
cheers
-
August 27th, 2008, 01:08 AM
#22
Re: Need a simple program!
Code:
C:\Documents and Settings\Xeon > help
-
August 27th, 2008, 03:43 AM
#23
Re: Need a simple program!
 Originally Posted by Xeon
And yeah, it's not surprising for noob programmers not to know how to use these command-line stuff if all they ever did was MFC visual stuff all done in Windows 98 / XP interface. 
So when you create a simple program like this, how do you run it on a friends machine that doesn't have Visual C++ installed?
Code:
#include <iostream>
int main()
{
std::cout << "Hello World";
}
Won't it seem strange that you can't run a simple "Hello World" program, but at the same time claim to be a Windows programmer?
The command-line has been an integral part of Windows. IMO, any programmer whos realm is Windows programming is seriously deficient (and I mean seriously) in the knowledge of the OS if they do not know how to use the command-line, even for simple commands.
Regards,
Paul McKenzie
-
August 27th, 2008, 09:28 AM
#24
Re: Need a simple program!
To gjs368: Finally, the "cd .." is the trick that solves all the problems! With this trick, I can navigate to any directory I want! Cheers! 
To SoulDog: It's been years! I still remember you, your ID and your avatar! Seems that for a lot of people here, once they've set an avatar, it's for life! 
From Paul:
So when you create a simple program like this, how do you run it on a friends machine that doesn't have Visual C++ installed?
Why does he need VC++? If I still had my VC++ compiler, I just need to paste the folder-looping code and compile the program into an EXE file and send the file to him, and he'll place the file in his folder and execute the program and it'll do the rest. 
Won't it seem strange that you can't run a simple "Hello World" program, but at the same time claim to be a Windows programmer?
Actually, for the command line, I only know how to open the window (Start menu > Run > command).
And the only commands I know of are: cd and dir.
I dunno anything else.
And from the VC++ studio, all I need is to click the Execute button to run my Win32 DOS programs, I don't even need anything. That software shielded me from everything.
The command-line has been an integral part of Windows. IMO, any programmer whos realm is Windows programming is seriously deficient (and I mean seriously) in the knowledge of the OS if they do not know how to use the command-line, even for simple commands.
As long as the Windows programmer isn't creating any low-level software, he doesn't even need to know how to use the command line.
If you see those "Teach yourself VC++ ... in 21 days" or Jeff Prosise's MFC programming kind of books, they don't even mention the command line.
All they ever talk about are C++ code, VC++ software usage and MFC.
IMO, it's possible for a Windows programmer to write functional Windows programmers without even knowing there's such a thing called "command line".
Now, pls zip your mouth, go to bed and be a good little boy.
You should laugh more and be more tolerant of noobs.
"Hell is calling for you!" - Rufus, from Valkyrie Profile 2 : Silmeria
"I'm getting tired of you devils.....finishing strike......Final Blast!" - Arngrim, from Valkyrie Profile 2 : Silmeria
-
August 27th, 2008, 10:46 AM
#25
Re: Need a simple program!
 Originally Posted by Xeon
As long as the Windows programmer isn't creating any low-level software, he doesn't even need to know how to use the command line.
There is a lot of software that is not low-level, but is started via command-line. For example, we have a utility that automatically scans images via TWAIN. The program is started from the command-line, however the retrieval of images is done via whatver UI of the scanner happens to be.
There are other utilities that do things like append image files together, start database engines, etc. These are not "low-level", as GUI wrappers can and have been written for these types of programs.
If you see those "Teach yourself VC++ ... in 21 days" or Jeff Prosise's MFC programming kind of books, they don't even mention the command line. All they ever talk about are C++ code, VC++ software usage and MFC.
And if you were to get general C++ books, no mention is made of GUI, clicking on icons or anything else. You are only given a C++ program, similar to what I posted.
IMO, it's possible for a Windows programmer to write functional Windows programmers without even knowing there's such a thing called "command line".
Try to find a Windows job with not knowing anything about simple comand-line commands. You will get strange looks by anyone who is a Windows professional in C++, no matter what applications they happen to be producing, whether they are all GUI, low level, mid level or whatever.
You should laugh more and be more tolerant of noobs.
The ironic thing is that general C++ books for newbies assume you know how to use the command-line.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; August 27th, 2008 at 11:09 AM.
-
August 27th, 2008, 11:07 AM
#26
Re: Need a simple program!
 Originally Posted by Xeon
Why does he need VC++? If I still had my VC++ compiler, I just need to paste the folder-looping code and compile the program into an EXE file and send the file to him, and he'll place the file in his folder and execute the program and it'll do the rest. 
I am referring to the simle "Hello World" program that I posted. Also by "friend", I could also mean any other computer that doesn't have VC++ installed.
Actually, for the command line, I only know how to open the window (Start menu > Run > command).
And the only commands I know of are: cd and dir.
Hopefully you also know how to run executable programs. All you need to do is type in the name of the exe and hit enter.
As long as the Windows programmer isn't creating any low-level software, he doesn't even need to know how to use the command line.
I'll add that many Java programmers will disagree with you.
Regards,
Paul McKenzie
Last edited by Paul McKenzie; August 27th, 2008 at 11:53 AM.
-
August 31st, 2008, 12:06 PM
#27
Re: Need a simple program!
Xeon,
One last tidbit of info regarding Windows Command line stuff... Most all of the built-in functions (like cd) offer some help (sort of like UNIX man pages).
If you want to learn more about a command, type the name of the command follwed by a space and an then /? like this:
C:\>cd /?
If help is available (it is for the cd command), the help information for the related command will be output to the command window for your review.
If you want to learn more about other command line tools that come with the Windows cmd shell, type help at the command line prompt. It will return a pretty good list of useful utilities and a brief summary of what those commands do.
-
August 31st, 2008, 12:27 PM
#28
Re: Need a simple program!
-
August 31st, 2008, 04:36 PM
#29
Re: Need a simple program!
 Originally Posted by gjs368
(Just like MS to go half-way by letting you use spaces and then have grief over trying to get there....)
Well, it's the same for every shell, something has to be done to indicate that it's not parameters. In Linux (Debian) the standard way is using \ before every space character, can't say that's better (quotes are supported as well)
Edit: By the way, it took a long time but the shell now (since NT4 I think) have one of the *nix shell's handy functions "TAB to complete the line"
Try typing cd and then hit TAB and a dir will be added to your command line. If it's not the correct dir hit TAB again until it is. Giving the first character of the dir before pressing TAB speeds it up even more.
Last edited by S_M_A; August 31st, 2008 at 04:47 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|