Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, my question is how to check how many times my MFC dialog application is started. When I start it once, I have an int variable that is equal to 1. When I start it again, it should increase - variable++ and so on. I don't know how to make the check for that.

Thanks for your help in advance!
Posted
Updated 27-Dec-10 6:37am
v3

There are a lot of ways you can approach this.

0) Put the counter in a data file.

1) Put the counter in the registry.

2) Put the counter into a DLL file.


 
Share this answer
 
Comments
Rajesh R Subramanian 28-Dec-10 4:43am    
Good suggestions.
u can create a shared data segment, so that everytime when the process starts u can just increment a variable in that segment. it easy.
How to share a data segment in a DLL[^]

or u can write count to a file,registry or whatever :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900