Click here to Skip to main content
15,561,980 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: __debugbreak(); Pin
Philippe Mori18-Jun-11 6:17
Philippe Mori18-Jun-11 6:17 
Question[Win32]Set Dialog Bitmap Background Pin
Member 296547117-Jun-11 14:20
Member 296547117-Jun-11 14:20 
AnswerRe: [Win32]Set Dialog Bitmap Background Pin
Cheongwadae17-Jun-11 15:34
Cheongwadae17-Jun-11 15:34 
GeneralRe: [Win32]Set Dialog Bitmap Background Pin
Ram Shelke17-Jun-11 23:09
Ram Shelke17-Jun-11 23:09 
AnswerRe: [Win32]Set Dialog Bitmap Background Pin
enhzflep18-Jun-11 4:05
enhzflep18-Jun-11 4:05 
QuestionError 2248: cannot access protected member declared in CWinapp Pin
eastman7517-Jun-11 9:23
eastman7517-Jun-11 9:23 
QuestionRe: Error 2248: cannot access protected member declared in CWinapp Pin
Abhi Lahare17-Jun-11 9:36
Abhi Lahare17-Jun-11 9:36 
AnswerRe: Error 2248: cannot access protected member declared in CWinapp Pin
eastman7521-Jun-11 20:23
eastman7521-Jun-11 20:23 
I've been trying to write into the registry some data not related to the application in case.
As it happens CWinApp functions are not intended for such usage -- they are intended to write the registration data of the running application. In that case the correct usage is as follows:
1. Place call to the SetRegistryKey function in the "InitInstance". For example,
BOOL DerivedApp::InitInstance()
{
	// Standard initialization

	LPCTSTR lpszRegistryKey = "SomeSection" ;
	SetRegistryKey(lpszRegistryKey) ;
	. . .
}

2. Place call to the other necessary functions in the proper place of your application.
For example,
void SomeClass::OnStart() 
{
	. . .

	LPCTSTR lpszSection    = "SomeSection" ;
	LPCTSTR lpszStringItem = "SomeString" ;
        LPCTSTR lpszValue      = "SomeStringValue" ;
	if (!AfxGetApp()->;WriteProfileString(lpszSection, lpszStringItem, lpszValue))
		AfxMessageBox("Registry settings weren't modified.") ;
        . . .
}

I've checked it -- it works. But not in the case if you have to write into the Registry some data not related to your application.

Regards to all of you, chaps!
AnswerRe: Error 2248: cannot access protected member declared in CWinapp Pin
Albert Holguin17-Jun-11 9:44
professionalAlbert Holguin17-Jun-11 9:44 
GeneralRe: Error 2248: cannot access protected member declared in CWinapp Pin
eastman7517-Jun-11 23:10
eastman7517-Jun-11 23:10 
GeneralRe: Error 2248: cannot access protected member declared in CWinapp Pin
Richard MacCutchan17-Jun-11 23:52
mveRichard MacCutchan17-Jun-11 23:52 
GeneralRe: Error 2248: cannot access protected member declared in CWinapp Pin
Albert Holguin18-Jun-11 7:38
professionalAlbert Holguin18-Jun-11 7:38 
GeneralRe: Error 2248: cannot access protected member declared in CWinapp Pin
eastman7519-Jun-11 6:01
eastman7519-Jun-11 6:01 
GeneralRe: Error 2248: cannot access protected member declared in CWinapp Pin
eastman7520-Jun-11 6:39
eastman7520-Jun-11 6:39 
GeneralRe: Error 2248: cannot access protected member declared in CWinapp Pin
Albert Holguin20-Jun-11 8:25
professionalAlbert Holguin20-Jun-11 8:25 
AnswerRe: Error 2248: cannot access protected member declared in CWinapp Pin
eastman7520-Jun-11 19:34
eastman7520-Jun-11 19:34 
QuestionUnresolved external Symbol Pin
William Engberts17-Jun-11 5:14
William Engberts17-Jun-11 5:14 
AnswerRe: Unresolved external Symbol Pin
Albert Holguin17-Jun-11 5:16
professionalAlbert Holguin17-Jun-11 5:16 
GeneralRe: Unresolved external Symbol Pin
William Engberts17-Jun-11 5:20
William Engberts17-Jun-11 5:20 
GeneralRe: Unresolved external Symbol Pin
Albert Holguin17-Jun-11 5:25
professionalAlbert Holguin17-Jun-11 5:25 
GeneralRe: Unresolved external Symbol Pin
MicroVirus17-Jun-11 5:26
MicroVirus17-Jun-11 5:26 
GeneralRe: Unresolved external Symbol Pin
William Engberts17-Jun-11 5:30
William Engberts17-Jun-11 5:30 
GeneralRe: Unresolved external Symbol Pin
Albert Holguin17-Jun-11 5:29
professionalAlbert Holguin17-Jun-11 5:29 
GeneralRe: Unresolved external Symbol Pin
William Engberts17-Jun-11 5:27
William Engberts17-Jun-11 5:27 
GeneralRe: Unresolved external Symbol Pin
Albert Holguin17-Jun-11 5:34
professionalAlbert Holguin17-Jun-11 5:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.