Click here to Skip to main content
16,012,168 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionVC6 compiler bug? Pin
Ravi Bhavnani5-Sep-05 5:24
professionalRavi Bhavnani5-Sep-05 5:24 
AnswerRe: VC6 compiler bug? Pin
Gary R. Wheeler5-Sep-05 5:35
Gary R. Wheeler5-Sep-05 5:35 
GeneralRe: VC6 compiler bug? Pin
Ravi Bhavnani5-Sep-05 5:45
professionalRavi Bhavnani5-Sep-05 5:45 
GeneralRe: VC6 compiler bug? Pin
Gary R. Wheeler5-Sep-05 5:49
Gary R. Wheeler5-Sep-05 5:49 
GeneralRe: VC6 compiler bug? Pin
Bob Stanneveld5-Sep-05 9:46
Bob Stanneveld5-Sep-05 9:46 
GeneralRe: VC6 compiler bug? Pin
Ravi Bhavnani5-Sep-05 9:53
professionalRavi Bhavnani5-Sep-05 9:53 
QuestionHelp on WebBrowser Pin
Cao Jianlin5-Sep-05 5:05
Cao Jianlin5-Sep-05 5:05 
QuestionRegistry Editing C++ Pin
u6ik5-Sep-05 5:03
u6ik5-Sep-05 5:03 
I seem to have a compatibility issue with functions accessing the registry. All XP systems work well but 98 and 2K seem to decide they won't play. Its common to all Reg...Ex() functions. Anyone know how to solve this cross Windows issue before I start coding everything in 16bit.

Many thanks Big Grin | :-D

<br />
bool WriteKey(char * key_type, char * key)<br />
{<br />
	bool status = true; // OK<br />
<br />
	LONG ret;<br />
<br />
	HKEY kh1, kh2;<br />
<br />
	DWORD disposition;<br />
	<br />
	char *buf1;<br />
	char *buf2;<br />
<br />
	buf1 = new char[256];<br />
	buf2 = new char[256];<br />
<br />
<br />
	// add a key for the new vendor<br />
	ret = RegCreateKeyEx(HKEY_LOCAL_MACHINE, <br />
		"SOFTWARE\\KEY1", <br />
		0,<br />
		NULL,<br />
		REG_OPTION_NON_VOLATILE,<br />
		KEY_ALL_ACCESS,<br />
		NULL,<br />
		&kh1,<br />
		&disposition);<br />
<br />
	// add a key for the new app<br />
	ret = RegCreateKeyEx(kh1, <br />
		"KEY2",<br />
		0,<br />
		NULL,<br />
		REG_OPTION_NON_VOLATILE,<br />
		KEY_ALL_ACCESS,<br />
		NULL,<br />
		&kh2,<br />
		&disposition);<br />
	<br />
<br />
	if(ret != ERROR_SUCCESS)<br />
	{<br />
		MsgBox("WriteKey(): RegCreateKeyEx: Failed.");<br />
		status = false;<br />
	}<br />
<br />
	// create sn<br />
	ret = RegSetValueEx(kh2, key_type,	0,	REG_SZ, (CONST BYTE *) key, strlen(key) + 1);<br />
<br />
	if(ret != ERROR_SUCCESS)<br />
	{<br />
		MsgBox("WriteKey(): RegSetValueEx: Failed.");<br />
		status = false;<br />
	}<br />
<br />
	// close the new key<br />
	ret = RegCloseKey(kh1);<br />
	ret = RegCloseKey(kh2);<br />
<br />
	if(ret != ERROR_SUCCESS)<br />
	{<br />
		MsgBox("WriteKey(): RegCloseKey: Failed.");<br />
		status = false;<br />
	}<br />
<br />
	delete buf1;<br />
	delete buf2;<br />
<br />
	return status;<br />
}<br />


u6ik
AnswerRe: Registry Editing C++ Pin
u6ik5-Sep-05 6:44
u6ik5-Sep-05 6:44 
QuestionAbout MS Access Database in vc++:==Plz Help Pin
parims5-Sep-05 3:13
parims5-Sep-05 3:13 
AnswerRe: About MS Access Database in vc++:==Plz Help Pin
Marc Soleda5-Sep-05 3:39
Marc Soleda5-Sep-05 3:39 
QuestionRemove Device Pin
Peter Prescher5-Sep-05 2:56
Peter Prescher5-Sep-05 2:56 
QuestionChanging Color of Ctrl Pin
Identity Undisclosed5-Sep-05 2:40
Identity Undisclosed5-Sep-05 2:40 
AnswerRe: Changing Color of Ctrl Pin
toxcct5-Sep-05 2:48
toxcct5-Sep-05 2:48 
AnswerRe: Changing Color of Ctrl Pin
seq-5-Sep-05 11:11
seq-5-Sep-05 11:11 
QuestionCHttp Pin
Tcpip20055-Sep-05 2:15
Tcpip20055-Sep-05 2:15 
AnswerRe: CHttpFile Pin
Tcpip20055-Sep-05 2:19
Tcpip20055-Sep-05 2:19 
GeneralRe: CHttpFile Pin
Neagoe Gabriel5-Sep-05 2:42
Neagoe Gabriel5-Sep-05 2:42 
GeneralRe: CHttpFile Pin
Tcpip20055-Sep-05 2:52
Tcpip20055-Sep-05 2:52 
GeneralRe: CHttpFile Pin
Neagoe Gabriel5-Sep-05 4:23
Neagoe Gabriel5-Sep-05 4:23 
AnswerRe: CHttp Pin
MailtoGops5-Sep-05 3:12
MailtoGops5-Sep-05 3:12 
AnswerRe: CHttp Pin
Gary R. Wheeler5-Sep-05 4:04
Gary R. Wheeler5-Sep-05 4:04 
Questionhwnd Pin
Ali Tavakol5-Sep-05 1:53
Ali Tavakol5-Sep-05 1:53 
AnswerRe: hwnd Pin
Bob Stanneveld5-Sep-05 2:00
Bob Stanneveld5-Sep-05 2:00 
Answer[Message Deleted] Pin
Neagoe Gabriel5-Sep-05 2:00
Neagoe Gabriel5-Sep-05 2:00 

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.