|
|
|
Re: Different form
Started by agenore at 04-26-2006 11:32 PM. Topic has 20 replies.
|
|
04-26-2006, 11:32 PM
|
agenore

Joined on 03-21-2006
Parma
Posts 26
|
Re: Different form
|
|
|
|
|
Very well, I have done how you said. It Works (of course), but now !!!! News !!! I have another question. I have done 2 menu items and I put the relative function into the CXXXMdiFrame (how from manual). For use the m_templateList I have to use CMyDocManager (I think that It's right). Into that class I made 'OpenDialog' method. Now by AfxGetApp() I have used m_pDocManager pointer but I don't found the new method. I don't know why!!
|
|
|
|
|
Report
|
|
|
|
04-28-2006, 10:53 PM
|
Yasir
Joined on 03-15-2006
Posts 44
|
|
|
Hi
First of i m sorry to reply late i was unalbe to see ur post :S.
I could not get why are you unable to get your new method. Do a little type casting. Type cast your m_pDocManager pointer to CMyDocManager then see if it work.
If dont plz let me know.
Best Regards
-Yasir
|
|
|
|
|
Report
|
|
|
|
04-29-2006, 10:34 AM
|
agenore

Joined on 03-21-2006
Parma
Posts 26
|
Re: Different form
|
|
|
|
|
Hi, Don't worry for the late. About the cast, I heve just tried it but I had a compile error. I have done so:
void CTestMDIApp::OnMyNewDlg() { CMyDocManager *My; My = (CMyDocManager)(this->m_pDocManager); }
When I compile I obtain this error cannot convert from 'class CDocManager *' to 'class CMyDocManager
but the strange is that m_pDocManager is a CMyDocManager
|
|
|
|
|
Report
|
|
|
|
04-30-2006, 5:02 AM
|
Yasir
Joined on 03-15-2006
Posts 44
|
|
|
Hi
Your are doing a mistake in type casting plz do it as follows.
My = (CMyDocManager*)(this->m_pDocManager);
While m_pDocManager is a pointer and you trying to type cast it as an object its an error. Just place and asterik (for type casting as pointer) as above.
It will work. and then use My pointer to call ur functions.
Let me know if it works.
Best Regards
-Yasir
|
|
|
|
|
Report
|
|
|
|
04-30-2006, 7:22 AM
|
agenore

Joined on 03-21-2006
Parma
Posts 26
|
|
|
It is right!!! I'm a Idiot
|
|
|
|
|
Report
|
|
|
|
04-30-2006, 10:39 PM
|
Yasir
Joined on 03-15-2006
Posts 44
|
|
|
:P i have not said any thing.
|
|
|
|
|
Report
|
|
|
|
|
Codersource.Net » Programming » MFC Programming » Re: Different form
|
|
| |
|