Click here to Skip to main content
15,918,333 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionNeed suggestion for thread test Pin
includeh1023-May-11 5:32
includeh1023-May-11 5:32 
QuestionRe: Need suggestion for thread test Pin
David Crow23-May-11 5:58
David Crow23-May-11 5:58 
AnswerRe: Need suggestion for thread test Pin
CPallini23-May-11 6:06
mveCPallini23-May-11 6:06 
GeneralRe: Need suggestion for thread test Pin
includeh1023-May-11 6:19
includeh1023-May-11 6:19 
GeneralRe: Need suggestion for thread test Pin
CPallini23-May-11 9:14
mveCPallini23-May-11 9:14 
AnswerRe: Need suggestion for thread test Pin
Luc Pattyn23-May-11 6:18
sitebuilderLuc Pattyn23-May-11 6:18 
GeneralRe: Need suggestion for thread test Pin
includeh1023-May-11 6:23
includeh1023-May-11 6:23 
GeneralRe: Need suggestion for thread test Pin
CPallini23-May-11 8:06
mveCPallini23-May-11 8:06 
GeneralRe: Need suggestion for thread test Pin
Maximilien24-May-11 4:15
Maximilien24-May-11 4:15 
AnswerRe: Need suggestion for thread test Pin
Stefan_Lang24-May-11 0:06
Stefan_Lang24-May-11 0:06 
QuestionCFileDialog Pin
sarfaraznawaz23-May-11 3:19
sarfaraznawaz23-May-11 3:19 
QuestionRe: CFileDialog Pin
David Crow23-May-11 3:50
David Crow23-May-11 3:50 
AnswerRe: CFileDialog Pin
Richard MacCutchan23-May-11 4:57
mveRichard MacCutchan23-May-11 4:57 
GeneralRe: CFileDialog Pin
sarfaraznawaz23-May-11 19:16
sarfaraznawaz23-May-11 19:16 
GeneralRe: CFileDialog Pin
Chandrasekharan P23-May-11 19:29
Chandrasekharan P23-May-11 19:29 
GeneralRe: CFileDialog Pin
sarfaraznawaz25-May-11 19:33
sarfaraznawaz25-May-11 19:33 
AnswerRe: CFileDialog Pin
abhishek.biradar23-May-11 19:42
abhishek.biradar23-May-11 19:42 
QuestionRunning a c++ program Pin
tasumisra23-May-11 1:22
tasumisra23-May-11 1:22 
AnswerRe: Running a c++ program Pin
Richard MacCutchan23-May-11 1:30
mveRichard MacCutchan23-May-11 1:30 
GeneralRe: Running a c++ program Pin
tasumisra23-May-11 1:33
tasumisra23-May-11 1:33 
GeneralRe: Running a c++ program [modified] Pin
Legor23-May-11 1:45
Legor23-May-11 1:45 
GeneralRe: Running a c++ program Pin
tasumisra23-May-11 1:52
tasumisra23-May-11 1:52 
GeneralRe: Running a c++ program Pin
Legor23-May-11 2:40
Legor23-May-11 2:40 
The builded exe is in your Release and / or Debug folder. Look for it. I didn't say the exe will be called TimeStamp.exe at you local PC! It was just an example. The name of the exe depends on your Project Settings (the project name by default).

But then if you want to use only the logic shown in the code that you've linked in a program of yours, of course you don't need to build this exe at all but rather use the code that fullfills the desired task. And then again you dont have to provide the filename as command line parameter. This is totally up to you.

For the beginning .. it would for your case probably enough if you change the following line.
hFile = CreateFile(argv[1], GENERIC_READ, FILE_SHARE_READ, NULL,OPEN_EXISTING, 0, NULL);


The argv[1] here contains the file name. You could also hard code this filename like
hFile = CreateFile("C:\tmp.txt", GENERIC_READ, FILE_SHARE_READ, NULL,OPEN_EXISTING, 0, NULL);


You'd also have to remove this if you dont want the code to be dependent of the number of command line parameters..
if( argc != 2 )
    {
        printf("This sample takes a file name as a parameter\n");
        return 0;
    }


Or get the filename somewhere else. i dont know what you want to do but you'll have to think of stuff like that for yourself.

I strongly advise you to go through some basic C/C++ tutorials, since you seem to lack some basic understandings of the language here.
GeneralRe: Running a c++ program Pin
Richard MacCutchan23-May-11 2:40
mveRichard MacCutchan23-May-11 2:40 
AnswerRe: Running a c++ program Pin
David Crow24-May-11 6:43
David Crow24-May-11 6:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.