About MFC
-
Hi I added a class in my MFC dialog based project. Now i want to declare a pointer object of my dialog class in .cpp file of newly added class to access members of dialog class in that cpp file. I declared that pointer like this CFileSenderDlg *fsD = new CFileSenderDlg; But program crashes at the point where i use this pointer to access a member function of dialog class. What it the mistake i am doing? Can anyone please help me in this regard? Thank you. We Believe in Excellence www.aqueelmirza.cjb.net
-
Hi I added a class in my MFC dialog based project. Now i want to declare a pointer object of my dialog class in .cpp file of newly added class to access members of dialog class in that cpp file. I declared that pointer like this CFileSenderDlg *fsD = new CFileSenderDlg; But program crashes at the point where i use this pointer to access a member function of dialog class. What it the mistake i am doing? Can anyone please help me in this regard? Thank you. We Believe in Excellence www.aqueelmirza.cjb.net
The code seems very clean. 1. Check whether the pointer get allocated properly or not (NULL or Junk value). 2. Check for the missing resources, which hadn' is not removed on deleting the control. 3. Check the message handlers SaRath.
"Don't Do Different things... Do Things Differently..." Understanding State Pattern in C++ -
The code seems very clean. 1. Check whether the pointer get allocated properly or not (NULL or Junk value). 2. Check for the missing resources, which hadn' is not removed on deleting the control. 3. Check the message handlers SaRath.
"Don't Do Different things... Do Things Differently..." Understanding State Pattern in C++Sorry i was wrong. In fact error occures when i try to declare the pointer. When i tried to debug it, It took me to afxwin1.inl and current pointer was on following lines. Can you please tell me what is the problem?
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle() { ASSERT(afxCurrentResourceHandle != NULL);
We Believe in Excellence www.aqueelmirza.cjb.net -
Hi I added a class in my MFC dialog based project. Now i want to declare a pointer object of my dialog class in .cpp file of newly added class to access members of dialog class in that cpp file. I declared that pointer like this CFileSenderDlg *fsD = new CFileSenderDlg; But program crashes at the point where i use this pointer to access a member function of dialog class. What it the mistake i am doing? Can anyone please help me in this regard? Thank you. We Believe in Excellence www.aqueelmirza.cjb.net
Aqueel wrote:
CFileSenderDlg *fsD = new CFileSenderDlg;
After this, you should create the dialog box also like:
fsD->Create(IDD_WHATEVER,Parent);
Also check that the actual dialog resource is really present by looking at the resource view, and then checking the ID for the dialog. this is this. -
Hi I added a class in my MFC dialog based project. Now i want to declare a pointer object of my dialog class in .cpp file of newly added class to access members of dialog class in that cpp file. I declared that pointer like this CFileSenderDlg *fsD = new CFileSenderDlg; But program crashes at the point where i use this pointer to access a member function of dialog class. What it the mistake i am doing? Can anyone please help me in this regard? Thank you. We Believe in Excellence www.aqueelmirza.cjb.net
See here
CTest::CTest(CWnd* pParent /*=NULL*/) : CDialog(CTest::IDD, pParent) { Create(CTest::IDD,pParent); } -------------------- CTest *m_Test; m_Test=new CTest(this);
_**
**_
whitesky
-
Sorry i was wrong. In fact error occures when i try to declare the pointer. When i tried to debug it, It took me to afxwin1.inl and current pointer was on following lines. Can you please tell me what is the problem?
_AFXWIN_INLINE HINSTANCE AFXAPI AfxGetResourceHandle() { ASSERT(afxCurrentResourceHandle != NULL);
We Believe in Excellence www.aqueelmirza.cjb.netSorry for the late reply. Walk ur call stack and find from where this call occurs. check for missing resources that may be the problem SaRath.
"Don't Do Different things... Do Things Differently..." Understanding State Pattern in C++