In an MFC app: WriteProfileString, GetProfilestring
and WriteProfileInt, ...
--
Scott McPhillips [MVP VC++]
To be exact CWinApp::WriteProfileString wich is different from the API
::WriteProfileString. Just to not confuse the OP.
Hans
Boy that sure worked great thanks. Do you know where this
data would be stored in the registry?
// Change the registry key under which our settings are stored.
SetRegistryKey(_T("MyCompany"));
In your InitInstance() routine in the main app .cpp file. This is used for
the main code (under HKCU\Software\MyCompany for example). This gets
appended with the name of the program so it will likely be something like
HKCU\Software\MyCompany\MyApp.
Tom
"Peter Olcott" <NoS...@SeeScreen.com> wrote in message
news:_MZgi.3036$uq2....@newsfe06.phx...
BOOL WriteProfileString( LPCTSTR lpszSection, LPCTSTR
lpszEntry, LPCTSTR lpszValue );
Under which registry key could this data be found:
WriteProfileString("MyCompany", "MyFieldName", "MyData");
???
I want to be able to find it using regedit.
> BOOL WriteProfileString( LPCTSTR lpszSection, LPCTSTR
> lpszEntry, LPCTSTR lpszValue );
> Under which registry key could this data be found:
> WriteProfileString("MyCompany", "MyFieldName", "MyData");
> ???
> I want to be able to find it using regedit.
[In this wild land where both bottom and (regrettably) top posting are
tolerated, please try to trim unnecessary quoting.]
You are not doing it right. Do like this:
SetRegistryKey(_T("MyCompany"));
WriteProfileString("MySectionName", "MyFieldName", "MyData");
Then the entry will appear in
HKCU\Software\MyCompany\MyApp\MySectionName\MyFieldName
The MyApp is inserted automatically by MFC.
--
David Wilkinson
Visual C++ MVP
Tom
"Peter Olcott" <NoS...@SeeScreen.com> wrote in message
news:16thi.10191$oh3...@newsfe03.phx...
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm