Click here to Skip to main content
15,915,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionstr.Format(" with a qoute " in a string"); ??? Pin
Jay Beckert20-Jan-02 6:15
Jay Beckert20-Jan-02 6:15 
AnswerRe: str.Format(" with a qoute " in a string"); ??? Pin
Jay Beckert20-Jan-02 6:29
Jay Beckert20-Jan-02 6:29 
GeneralRe: str.Format(" with a qoute " in a string"); ??? Pin
User 665820-Jan-02 7:06
User 665820-Jan-02 7:06 
QuestionDrag'n'Drop to Explorer windows? Pin
Lofote20-Jan-02 4:37
Lofote20-Jan-02 4:37 
AnswerRe: Drag'n'Drop to Explorer windows? Pin
Michael Dunn20-Jan-02 6:56
sitebuilderMichael Dunn20-Jan-02 6:56 
GeneralBYTE concatenation and strcat() questions Pin
Kuniva20-Jan-02 3:28
Kuniva20-Jan-02 3:28 
GeneralRe: BYTE concatenation and strcat() questions Pin
Michael Dunn20-Jan-02 6:58
sitebuilderMichael Dunn20-Jan-02 6:58 
GeneralWin2000 Registry Problem Pin
John Clump20-Jan-02 2:02
John Clump20-Jan-02 2:02 
Hi everyone. I originally was developing a program on a Win95 (osr2) machine, and the code below originally worked fine to write a value to the registry. I think switched to developing on a Win2000 machine, and found something odd. The code below did write to the registry fine, and I verified this with regedit, but after I reboot the machine, whatever I wrote to the registry was gone. I traced through my program many times, and I was not at any point in code erasing what was written. When I first started the program, the registry data was re-written to the registry and was read out successfully when the program was run a second time. But for some reason, whenever I rebooted the machine, the data was gone. I verified this using regedit, and ran this test several times. The reboot caused the data to be erased. This does not happen to any apps I have purchased, so I assume it is my code.
And, is limited to Win2000/NT? It did work on my Win95 development machine, as well as a friend's Win98 machine, as a release build; that is, all data was written to the registry, and was still there after reboot, and was read out succesfully every time.

This code writes to the usual hkey_current_user/software folder in the registry.

The code below writes a string the registry, which is the only data type I am writing to the registry.

<br />
long CRegKey::Write(LPCTSTR pszKey, LPCTSTR pszData)<br />
{<br />
	ASSERT(m_hKey); // m_hKey is the reg key set elsewhere in the class<br />
	ASSERT(pszKey);<br />
	ASSERT(pszData);<br />
	ASSERT(AfxIsValidAddress(pszData, strlen(pszData), FALSE));<br />
<br />
	return RegSetValueEx(m_hKey, pszKey, 0L, REG_SZ, (CONST BYTE*) pszData, strlen(pszData)+1);<br />
}<br />

GeneralRe: Win2000 Registry Problem Pin
Michael Dunn20-Jan-02 7:02
sitebuilderMichael Dunn20-Jan-02 7:02 
GeneralHelp a Newbie please!!!:confused: Pin
20-Jan-02 1:16
suss20-Jan-02 1:16 
GeneralRe: Help a Newbie please!!!:confused: Pin
Michael P Butler20-Jan-02 2:08
Michael P Butler20-Jan-02 2:08 
GeneralPb Copy/Pasting DIB with Alpha Channel Pin
yarp19-Jan-02 21:35
yarp19-Jan-02 21:35 
GeneralRe: Pb Copy/Pasting DIB with Alpha Channel Pin
Christian Graus19-Jan-02 22:52
protectorChristian Graus19-Jan-02 22:52 
GeneralRe: Pb Copy/Pasting DIB with Alpha Channel Pin
yarp19-Jan-02 23:28
yarp19-Jan-02 23:28 
GeneralRe: Pb Copy/Pasting DIB with Alpha Channel Pin
Christian Graus19-Jan-02 23:35
protectorChristian Graus19-Jan-02 23:35 
GeneralRe: Pb Copy/Pasting DIB with Alpha Channel Pin
yarp20-Jan-02 11:35
yarp20-Jan-02 11:35 
GeneralRe: Pb Copy/Pasting DIB with Alpha Channel Pin
Christian Graus20-Jan-02 11:55
protectorChristian Graus20-Jan-02 11:55 
GeneralRe: Pb Copy/Pasting DIB with Alpha Channel Pin
yarp20-Jan-02 12:06
yarp20-Jan-02 12:06 
Generaltask manager Pin
Mazdak19-Jan-02 21:34
Mazdak19-Jan-02 21:34 
GeneralRe: task manager Pin
SergueiP19-Jan-02 22:38
SergueiP19-Jan-02 22:38 
GeneralRe: task manager Pin
Mazdak20-Jan-02 1:04
Mazdak20-Jan-02 1:04 
GeneralRe: task manager Pin
Christopher Lord20-Jan-02 11:41
Christopher Lord20-Jan-02 11:41 
Questionabout MSFlexgrid? Pin
anju19-Jan-02 20:58
anju19-Jan-02 20:58 
AnswerRe: about MSFlexgrid? Pin
Christian Graus19-Jan-02 22:53
protectorChristian Graus19-Jan-02 22:53 
AnswerRe: about MSFlexgrid? Pin
Qadddd21-May-02 6:17
Qadddd21-May-02 6:17 

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.