Click here to Skip to main content
15,922,512 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert short to Cstring... Pin
Albert Holguin14-Jun-11 3:29
professionalAlbert Holguin14-Jun-11 3:29 
AnswerRe: convert short to Cstring... Pin
Richard MacCutchan14-Jun-11 2:41
mveRichard MacCutchan14-Jun-11 2:41 
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 
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
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 
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 

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.