Visual C++ Problem, CComboBox

This is a discussion on Visual C++ Problem, CComboBox within the C++ Programming forums, part of the General Programming Boards category; I am having a problem getting my combo box to drop down in Visual C++ here is the code.
Code:
...

The program compiles with no errors or warnings and doesn't have any runtime errors once running, but when I click on the appropriate combo box basically nothing happens, could someone please tell me what I am doing wrong.

You are creating a new CComboBox object in the handler for the object the event is happening for. You need to then call this->Dir(DDL_DRIVES, "C:*.*") otherwise your calling that for a newly created CComboBox object.

While you're breakin' down my back n'
I been rackin' out my brain
It don't matter how we make it
'Cause it always ends the same
You can push it for more mileage
But your flaps r' wearin' thin
And I could sleep on it 'til mornin'
But this nightmare never ends
Don't forget to call my lawyers
With ridiculous demands
An you can take the pity so far
But it's more than I can stand
'Cause this couchtrip's gettin' older
Tell me how long has it been
'Cause 5 years is forever
An you haven't grown up yet
-- You Could Be Mine - Guns N' Roses

I get an assertion error while trying to drop doen the combo box, I realise I haven't copied your code directly but when I did copy your code directly I again got an assertion error, can anyone explain how this combo box is supposed to work? This is doing my head in.

You're creating a new CComboBox object. You don't want to do that. You need to use the already in use one. Remember the event is triggered because you already have a CComboBox in existence. Just use this:

That code will do what you want to do, because you have a combo box named IDC_COMBO1. The GetDlgItem() will get a CWnd pointer to the child window with the id passed to it. Then you type cast it back to the object type you need. In this case CComboBox*.

While you're breakin' down my back n'
I been rackin' out my brain
It don't matter how we make it
'Cause it always ends the same
You can push it for more mileage
But your flaps r' wearin' thin
And I could sleep on it 'til mornin'
But this nightmare never ends
Don't forget to call my lawyers
With ridiculous demands
An you can take the pity so far
But it's more than I can stand
'Cause this couchtrip's gettin' older
Tell me how long has it been
'Cause 5 years is forever
An you haven't grown up yet
-- You Could Be Mine - Guns N' Roses

Sorry man, I get you now, you must have been getting well frustrated, right I was writing the code inside the handler for a combo box that was already created and then i was calling a constructor and create function for another combo box, it was bound to get ........ed off, when you showed me those lines of code I dint realise you dint mean just edit them it was JUST those lines of code I needed, right, you have really got me back on track now, again thanks a lot.

While you're breakin' down my back n'
I been rackin' out my brain
It don't matter how we make it
'Cause it always ends the same
You can push it for more mileage
But your flaps r' wearin' thin
And I could sleep on it 'til mornin'
But this nightmare never ends
Don't forget to call my lawyers
With ridiculous demands
An you can take the pity so far
But it's more than I can stand
'Cause this couchtrip's gettin' older
Tell me how long has it been
'Cause 5 years is forever
An you haven't grown up yet
-- You Could Be Mine - Guns N' Roses