SetRegistryKey和应用程序名称 [英] SetRegistryKey and application name
问题描述
对于基于MFC的应用程序(例如,称为ABCD),
一次执行以下操作:
SetRegistryKey("MyCompany")
然后发出:
WriteProfileInt("MySect","MyEntry",12345);
注册表随后在以下位置获得一个条目:
HKCU \软件\ MyCompany \ ABCD \ MySect \ MyEntry.
仅当框架名称时,框架如何计算该应用程序名称
是否获得类似于"CABCDApp"的类名?一定有魔法
还是代码使用幕后的.exe名称作为应用程序名称?
干杯,
Siggy
With MFC based applications (e.g. call it ABCD),
once one performs the:
SetRegistryKey("MyCompany")
and then issues a:
WriteProfileInt("MySect", "MyEntry", 12345);
the registry then gets an entry under:
HKCU\Software\MyCompany\ABCD\MySect\MyEntry.
How does the framework work out the app name when it only
gets the classname like ''CABCDApp'' ? There must be some magic
or the code uses the .exe name under the covers as the app name ?
Cheers,
Siggy
推荐答案
框架如何在以下情况下确定应用程序名称只是
是否获得类似于"CABCDApp"的类名?
How does the framework work out the app name when it only
gets the classname like ''CABCDApp'' ?
我想这不是Framework:它是Visual Studio的应用程序向导".
:)
I guess it isn''t the Framework: it is the Visual Studio''s Application Wizard.
:)
好吧,我进一步深入了代码,应用程序名称通过CWinApp代码中的:: GetModuleFileName()派生.
Ok, I dived a bit deeper into the code and the app name is derived via ::GetModuleFileName() somewhere in the CWinApp code.
这篇关于SetRegistryKey和应用程序名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!