Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

wrote:
How does the framework work out the app name when it only
gets the classname like 'CABCDApp' ?


I guess it isn't the Framework: it is the Visual Studio's Application Wizard.
:)
 
Share this answer
 
v2
Ok, I dived a bit deeper into the code and the app name is derived via ::GetModuleFileName() somewhere in the CWinApp code.
 
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