Re: CComboBox member variable causing stack overflow
Sorry,
It threw me when you mentioned add variables wizard.
I mistook it for Class Wizard.
But again, I reiterate, there is nothing wrong with adding the variable =
like you did.
The problem lies elsewhere.
I don't know what else you are doing in that dialog, but something, =
somewhere else in that dialog, is the problem.
"Nobody" <Nobody@yahoo.com> wrote in message =
news:eWPTuZj4HHA.748@TK2MSFTNGP04.phx.gbl...
Read the very bottom of this link.
http://www.mip.sdu.dk/ipl98/unofficial/visualc/tips_and_tricks.htm
HTH,
"Nobody" <Nobody@yahoo.com> wrote in message =
news:uK6rWXj4HHA.5316@TK2MSFTNGP04.phx.gbl...
I'm experiencing this failure with just a simple variable declaration.
There is nothing wrong with what you are doing.
There must something wrong somewhere else.
Try adding char array[500] and see if you still have that problem.
I suspect you will.
I think this may be a Visual C++ 6.0 issue?
I remember something like that happening to me.
(Let me know if you are)
If you are, then read up about deleting .Opt .Ncb and Clw files.
Visual C++ 6.0 was a pain when weird things like that happened.
(I had a batch file on hand to speed up the process.)
Also, you may want to include "afxwin.h", but that should not matter.
What you are doing is not the problem and you know that.
The problem lies elsewhere.
Where? I am not sure.
HTH,
"Lorn Davies" <efoda5446@yahoo.com> wrote in message =
news:1187502766.016924.262000@i38g2000prf.googlegroups.com...
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
...
};