Click here to Skip to main content
15,881,882 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
This piece of code as you suggested gives following error. Please Suggest.

Previous case : m_ComboStr1 is variable attached to the ComboBox (CString type)

Note: I'm new to VC++ programming.


error C2664: 'AddString' : cannot convert parameter 1 from 'unsigned char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast




// *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;

				do
				{	

				enumresult=RegEnumValue(phkResult, index, valuename, &valuenamesize, 0,
				NULL,
				valuedata,
				&valuedatasize);

					
				InsCombo->AddString(valuedata[index]);
				index ++;
			

				}while (enumresult != ERROR_NO_MORE_ITEMS);
				
				
				RegCloseKey(phkResult);  
			

				}

	// *Code Ends Here

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 
AnswerRe: ":" in struct Pin
Malli_S13-Jun-11 1:25
Malli_S13-Jun-11 1:25 
QuestionWrong icon on title bar Pin
Lianqing12-Jun-11 6:15
Lianqing12-Jun-11 6:15 
AnswerRe: Wrong icon on title bar Pin
Luc Pattyn12-Jun-11 7:06
sitebuilderLuc Pattyn12-Jun-11 7:06 
AnswerRe: Wrong icon on title bar Pin
MicroVirus13-Jun-11 7:45
MicroVirus13-Jun-11 7:45 
QuestionWSARecv and recv Pin
csrss12-Jun-11 2:54
csrss12-Jun-11 2:54 
QuestionIs it possible to make an application to show a modeless dialog and wait there(without executing the next statement) until the modeless dialog is closed Pin
manoharbalu10-Jun-11 19:54
manoharbalu10-Jun-11 19:54 

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.