Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: convert short to Cstring... Pin
Cool_Dev15-Jun-11 3:45
Cool_Dev15-Jun-11 3:45 
Question[SOLVED] Problem with adding set of strings from registry to combobox [modified] Pin
Gaurav Paul14-Jun-11 0:45
Gaurav Paul14-Jun-11 0:45 
AnswerRe: Problem with adding set of strings from registry to combobox Pin
Niklas L14-Jun-11 1:23
Niklas L14-Jun-11 1:23 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Gaurav Paul14-Jun-11 2:00
Gaurav Paul14-Jun-11 2:00 
AnswerRe: Problem with adding set of strings from registry to combobox Pin
Richard MacCutchan14-Jun-11 2:39
mveRichard MacCutchan14-Jun-11 2:39 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Gaurav Paul14-Jun-11 20:35
Gaurav Paul14-Jun-11 20:35 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Richard MacCutchan14-Jun-11 21:48
mveRichard MacCutchan14-Jun-11 21:48 
GeneralRe: Problem with adding set of strings from registry to combobox [modified] Pin
Gaurav Paul14-Jun-11 22:52
Gaurav Paul14-Jun-11 22:52 
I appreciate your help.

The same code worked; as I did a silly mistake I needed to increase the drop down area Roll eyes | :rolleyes:

Thanks Thumbs Up | :thumbsup:
// *Code Starts Here

				HKEY phkResult = NULL;
				LONG enumresult = 0;
				TCHAR valuename[256]={0};
				BYTE valuedata[4096]={0};
				DWORD valuenamesize = sizeof(valuename);
				DWORD valuedatasize = sizeof(valuedata);
				
				if (RegOpenKeyEx(HKEY_CURRENT_USER,
				"Software\\MY_PROG_KEY",0,KEY_READ,&phkResult) == ERROR_SUCCESS)
				{

                                CComboBox* InsCombo;
				InsCombo = (CComboBox*) GetDlgItem(IDC_COMBO1);
				int index = 0;


				while(RegEnumValue(phkResult, index, valuename, &valuenamesize, 0,
				NULL,
				valuedata,
				&valuedatasize)!=ERROR_NO_MORE_ITEMS)

				{
			
				InsCombo->AddString(reinterpret_cast<const char*>(valuedata));

				index ++;
				
				}
				
				}

				
	RegCloseKey(phkResult);  
	return TRUE;  

	// *Code Ends Here


modified on Wednesday, June 15, 2011 5:20 AM

GeneralRe: Problem with adding set of strings from registry to combobox Pin
Richard MacCutchan14-Jun-11 23:05
mveRichard MacCutchan14-Jun-11 23:05 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Gaurav Paul14-Jun-11 23:21
Gaurav Paul14-Jun-11 23:21 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Richard MacCutchan15-Jun-11 0:38
mveRichard MacCutchan15-Jun-11 0:38 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Gaurav Paul15-Jun-11 20:16
Gaurav Paul15-Jun-11 20:16 
QuestionRe: Problem with adding set of strings from registry to combobox Pin
David Crow14-Jun-11 4:42
David Crow14-Jun-11 4:42 
AnswerRe: Problem with adding set of strings from registry to combobox Pin
Gaurav Paul14-Jun-11 20:16
Gaurav Paul14-Jun-11 20:16 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
David Crow15-Jun-11 2:04
David Crow15-Jun-11 2:04 
GeneralRe: Problem with adding set of strings from registry to combobox Pin
Gaurav Paul15-Jun-11 20:17
Gaurav Paul15-Jun-11 20:17 
QuestionTemporary disable text edit change event? [solved] Pin
Vaclav_13-Jun-11 7:10
Vaclav_13-Jun-11 7:10 
AnswerRe: Temporary disable text edit change event? Pin
Abhi Lahare13-Jun-11 8:40
Abhi Lahare13-Jun-11 8:40 
AnswerRe: Temporary disable text edit change event? Pin
Niklas L13-Jun-11 8:50
Niklas L13-Jun-11 8:50 
GeneralRe: Temporary disable text edit change event? Pin
Vaclav_13-Jun-11 10:49
Vaclav_13-Jun-11 10:49 
Questionhow to implement OnPaint() in activex control Pin
rjkg13-Jun-11 1:53
rjkg13-Jun-11 1:53 
AnswerRe: how to implement OnPaint() in activex control Pin
Adam Roderick J13-Jun-11 2:00
Adam Roderick J13-Jun-11 2:00 
AnswerRe: how to implement OnPaint() in activex control Pin
ScottMcP13-Jun-11 11:24
ScottMcP13-Jun-11 11:24 
Question":" in struct Pin
Pranit Kothari12-Jun-11 23:15
Pranit Kothari12-Jun-11 23:15 
AnswerRe: ":" in struct Pin
వేంకటనారాయణ(venkatmakam)12-Jun-11 23:24
వేంకటనారాయణ(venkatmakam)12-Jun-11 23:24 

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.