Click here to Skip to main content
15,918,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPhysical Address Pin
Winston,Dang8-Oct-01 22:33
Winston,Dang8-Oct-01 22:33 
GeneralRe: Physical Address Pin
Oscar Vazquez9-Oct-01 8:01
Oscar Vazquez9-Oct-01 8:01 
QuestionDisplaying Tooltips on the scroll? Pin
Franz Klein8-Oct-01 22:21
Franz Klein8-Oct-01 22:21 
QuestionWin98 or Win NT? Pin
Daniel Visan8-Oct-01 21:58
Daniel Visan8-Oct-01 21:58 
AnswerRe: Win98 or Win NT? Pin
Christian Graus8-Oct-01 22:55
protectorChristian Graus8-Oct-01 22:55 
QuestionHow to check whether an URL is valid? Pin
phped8-Oct-01 21:48
phped8-Oct-01 21:48 
AnswerRe: How to check whether an URL is valid? Pin
9-Oct-01 1:48
suss9-Oct-01 1:48 
GeneralSimple ComboBox Problems Pin
Xavier Shay8-Oct-01 21:42
Xavier Shay8-Oct-01 21:42 
I'm writing an SDI application which uses a dialog box to prompt the user. In this dialogbox I have a 2 ComboBoxes which need to be populated with different data every time the dialog is called. I have two problems:

1. This is the major one. Although I get no errors, and I've stepped through the code, the ComboBoxes always remain empty. I've included code at the bottom to show what I'm doing at the moment.

2. This is more a coding design question. Where is the best place to put this code? I can't put it in the Class Constructor because that causes an assertion error (No hWnd?). At the moment I'm trapping the ShowWindow Message and setting a flag to say whether or not I've already added stuff to the ComboBoxes

Any Help would be appreciated,
- X

// Populate Combo Boxes
CComboBox* temp1;
CComboBox* temp2;
int i;

temp1 = (CComboBox *)GetDlgItem(IDC_MEM1); // IDC_MEM1 and 2 are the ID's
temp2 = (CComboBox *)GetDlgItem(IDC_MEM2); // Of the combo boxes

for (i = 0; i < 32; i++) {
temp1->AddString((LPCTSTR)m_pDoc->MemoryLocations[i]);
temp2->AddString((LPCTSTR)m_pDoc->MemoryLocations[i]);
}
GeneralRe: Simple ComboBox Problems Pin
Bernhard8-Oct-01 22:09
Bernhard8-Oct-01 22:09 
GeneralRe: Simple ComboBox Problems Pin
8-Oct-01 23:41
suss8-Oct-01 23:41 
GeneralRe: Simple ComboBox Problems Pin
Jon Hulatt9-Oct-01 1:01
Jon Hulatt9-Oct-01 1:01 
Generalpassing pointers to functions as function args Pin
mightymark8-Oct-01 21:30
mightymark8-Oct-01 21:30 
GeneralRe: passing pointers to functions as function args Pin
Andrew Torrance8-Oct-01 21:53
Andrew Torrance8-Oct-01 21:53 
GeneralRe: passing pointers to functions as function args Pin
Steen Krogsgaard8-Oct-01 23:08
Steen Krogsgaard8-Oct-01 23:08 
GeneralRe: passing pointers to functions as function args Pin
mightymark9-Oct-01 19:25
mightymark9-Oct-01 19:25 
GeneralRe: passing pointers to functions as function args Pin
Steen Krogsgaard10-Oct-01 1:33
Steen Krogsgaard10-Oct-01 1:33 
GeneralRe: passing pointers to functions as function args Pin
mightymark10-Oct-01 20:18
mightymark10-Oct-01 20:18 
GeneralRe: passing pointers to functions as function args Pin
mightymark9-Oct-01 20:27
mightymark9-Oct-01 20:27 
GeneralRe: passing pointers to functions as function args Pin
Steen Krogsgaard10-Oct-01 1:23
Steen Krogsgaard10-Oct-01 1:23 
GeneralRe: passing pointers to functions as function args Pin
mightymark10-Oct-01 20:21
mightymark10-Oct-01 20:21 
GeneralRe: passing pointers to functions as function args Pin
Steen Krogsgaard10-Oct-01 22:31
Steen Krogsgaard10-Oct-01 22:31 
GeneralMultilanguge ActiveX Control Pin
Fredrik Sigbjörn8-Oct-01 21:19
Fredrik Sigbjörn8-Oct-01 21:19 
GeneralShowing window with and without title bar Pin
D.D. de Kerf8-Oct-01 20:49
D.D. de Kerf8-Oct-01 20:49 
GeneralNDI Cache Pin
ColinDavies8-Oct-01 17:03
ColinDavies8-Oct-01 17:03 
GeneralMouse capture problem Pin
Mr.Freeze8-Oct-01 16:44
Mr.Freeze8-Oct-01 16:44 

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.