|
|
|
|
What I do is set up a timer to interupt every second, and then count the interupts. When you have got to your required count, you can the go off and do the functionality that you want to do
Mike
|
|
|
|
|
WM_TIMER
This is a very easy thing to use, but is not 100% accurate.
You will need SetTimer and KillTimer
|
|
|
|
|
How can I achieve, that "Enter" works on a certain Button ? I´d like to change this during program. Sometimes Button "A" should work on ENTER, sometimes another one.
|
|
|
|
|
If you have a dialog-based application, you could set the default button with CDialog::SetDefID( UINT nID ) where nID is the ID of the new default button.
Hope this helps
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Thanks, that works fine !
|
|
|
|
|
I'm writing a small app that has a number of classes in it. I would like to save the data to a single binary file. I understand how to write the data to the file, but when is comes to reading it again I'm lost.
If the data classes are written to the file in random order, (I know, not a good practice) how do I retrieve the data I have written to the file?
Or is it better to have a file for each class?
If you could point me in the right direction your help would be greatly appreciated...
Thanks, mcb36
|
|
|
|
|
You have of course to load your data in the same order you saved it. Otherwise you will get into big troubles.
|
|
|
|
|
So if I save class "A", then class "B", then class "C", that is the order I need to read it back in. That I can do, but how to I know when to move from class "A" to class "B"? is there a way to check if not more instances have been saved of each class? And what if on instances of class "B" have been saved? How do I know what data is saved in the file until I read it?
Thanks, mcb36
|
|
|
|
|
You need to store the number of instances of all classes that are saved in your file. But in general, the way to save your data is much more cleaner than that. You should take a look at serialization articles on the MSDN. A good way of doing that is to let each object save and load itself. So, if the object is made of several objects, it will save and load these specific objects, each of those are responsible for saving and loading themselves.
But in summary, if you need to save several objects without knowing the exact number (stored in an array for example), then you can simply save, before saving them, the number of elements of that type.
|
|
|
|
|
You can do it by using a chunk file. (An old Mac-invention if my mind serves me right).
It works like this:
Every item in a chunk file consists of a header and a (binary) data block.
The header has a fixed length (a struct), containing a label and the length of the following data block.
So when you write it, fill in the fields in the header and write it to the chunk file. Then write the data block to the chunk file.
When you read the chunk file, first read the header. Then you will know:
1.
The identification of the data block. (I.e. the class name)
2.
The data length (of the following data block).
Now you can choose either to read the data block, or discard it and continue reading the next header.
I have been using chunk files a lot in my work because:
1.
Every item is marked so I know in advance what data I can expect.
2.
I can easily skip the kind of data I don't want to read back.
Maybe you can try one?
Kakan
-- modified at 8:53 Wednesday 8th February, 2006
I agree with Cedric Moonen, you should have a look at serialisation. But if you find it less usable for you, the have a look at chunk files.
|
|
|
|
|
Thanks Kakan,
That sounds perfect for what I need to do = )
And thanks Cedric for your help = )
Thanks, mcb36
|
|
|
|
|
|
Please tell me the software used for the deployment of vc++ applications
Jeeva
|
|
|
|
|
there is not one particuliar, and when the project is compiled, it has no sense to precise that it was made using VC++, C#, VB, Java...
did you had a look at some MSI compilers, and InstallShield also ?
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20][VCalc 3.0 soon...]
|
|
|
|
|
|
Jeeva Mary Varghese wrote: Please tell me the software used for the deployment of vc++ applications
if you looking for widly use Freeware you can try Inno Setup[^] too
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello. How can I getthe letters to drivenames.
For example: I have the drivename "PhysicalDrive0" and need to get which letter the drive "PhysicalDrive0" has
Thanks for help, Ahmet.
|
|
|
|
|
See the following WMI classes: Win32_DiskPartition, Win32_LogicalDisk, and Win32_DiskDrive.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Are these recent functions that have been added "recently" ? They do not appear in my (of course not online) MSDN version (4.74) ?
~RaGE();
|
|
|
|
|
Rage wrote:
Are these recent functions that have been added "recently" ?
That depends on your definition of "recently." They require NT4 SP4 (NT4 came out in mid-1996).
Rage wrote: They do not appear in my (of course not online) MSDN version (4.74) ?
Do you have October 2001?
Win32_LogicalDisk
Win32_DiskPartition
Win32_DiskDrive
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Are these recent functions that have been added "recently" ? They do not appear in my (of course not online) MSND version (4.74) ?
~RaGE();
|
|
|
|
|
Thanks for your answer. That was, what I needed.
|
|
|
|