检查应用启动的次数 [英] Check how many times the app is started

查看:47
本文介绍了检查应用启动的次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我的问题是如何检查MFC对话框应用程序启动了多少次.当我一次启动它时,我有一个等于1的int变量.当我再次启动它时,它应该增加-变量++,依此类推.我不知道该怎么做.

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!

推荐答案

有很多方法可以解决这个问题.

0)将计数器放入数据文件中.

1)将计数器放在注册表中.

2)将计数器放入DLL文件.


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.



u可以创建一个共享数据段,以便每次进程启动时u都可以在该段中增加一个变量.很简单.
如何在DLL中共享数据段 [
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 :)


这篇关于检查应用启动的次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆