Re: CComboBox member variable causing stack overflow
I think you mean a dialog?
No, by app I meant an application. But yes, it's a dialog.
CCombBox c_MyBox;
/* the ID and the member variable should be correct and in the DoDataExchange member */
DDX_Control(pDX, IDC_MY_BOX, c_MyBox);
/* It should do that automatically, but it is something to keep in mind */
What should do it automatically? You mean use the add member variable
wizard? I don't use that nor have I gotten that far yet.
Declaring a member variable does not require me to add anything to the
DoDataExchange member, I should be able to declare the CComboBox
variable and it should be able to run fine. If I tried to use the
variable without it pointing to a control, then sure I can't expect to
run, but that's not the problem here. When I decide to finally use the
variable, then yes I will add it to DoDataExchange, but as of now I'm
experiencing this failure with just a simple variable declaration.
FYI, I did try declaring and associating correctly to DDX and fails
regardless.
When I run it through the debugger it gives me a stack overflow error.
What statement?
I guess your not stepping through, setting breakpoints and such?
Um, stack overflow, as well as a symbols not loaded load assembly
dialog. I did set breakpoints in my dialog header before the variable
declaration. It doesn't ever reach it before I get the error. If I
remove the variable declaration the app runs fine.
Posting some relevant could would be helpful.
#include afxcmn.h
class CMyDialog : public CDialog
{
CMyDialog(CWnd* pParent = NULL); // standard constructor
CComboBox m_combo; // not including this,
app runs fine
...
};