I am trying to populate a CComboBox
in a model dialogue in an MFC application. My data comes from an API and I manage to get that into a JSON array. I need to populate menu items of the CComboBox
with name
member of the JSON object.
I know how to access it in a for
loop. The problem is I don't know how to populate the CComboBox
with the names I have. I have a a DoDataExchange()
function in the .cpp file linked to the dialogue. I tried using the DDX_CBString
to populate, but it's only setting the text of combobox with the last name I have and not populating the menu items.
I am very new to the programming world itself, but managed to make some applications some how (basic ones)... I don't know how all these MFC things work... Trying to get a hang of it. If someone could help explaining this simply it will be a great help... Thank you :)