The problem with that is that when you add a new element to the map, only a pointer will be copied, not the contents of the array. So you need to keep track of these pointers and make sure they'll be deleted later.
The STL construct suggested above doesn't suffer from these problems, they'd do the copying for you.
I can think of no reason at all why anyone would want to use MFC when there is an easy to use alternative. Much of the MFC library is ancient and in a very bad shape. My personal experience is that, while you don't run into problems often, when you do it can take days to resolve the cause. I know for a fact that back in the time when I still used MFC I've lost weeks of valuable time just due to sloppy programming inside MFC. I've never had any such problems with STL.
I hope that I can see 2 treads call the function in turn.
Hope away. In software development, there is no room for hope.
FWIW: the macroscopic behavior of threads (at a rate the human eye can discern) often is quite different from their actual, microscopic behavior. That is due to the specific scheduling algorithms implemented in the operating system; there always are some constants (e.g. "time slice") and, at least with Windows, there even is some cheating as far as thread priorities go.
I ran the program sucessfully with out put as "This sample takes a file name as a parameter".
Now i am having a file like c:\temp.txt and i want to know timestamp for this what is supposed to be done for this.
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.
Having compiled and built this program you must have a program (xxx.exe?) in either your Debug or Release folder; check again. This is a simple console program that can be run in a command prompt window (are you really saying you do not understand this basic facility?) thus:
In order to add this functionality to your own project you can just copy and paste the relevant parts of the sample into your own project.
The best things in life are not things.
Last Visit: 31-Dec-99 18:00 Last Update: 22-Sep-23 2:16