CoderSource.net
Search
Different form
Started by agenore at 04-26-2006 11:32 PM. Topic has 20 replies.

Print Search « Previous Thread Next Thread »
   04-26-2006, 11:32 PM
agenore is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Angry [:@] 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 is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
Joined on 03-15-2006
Posts 44
Re: Different form
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 is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Super Angry [8o|] 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 is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
Joined on 03-15-2006
Posts 44
Re: Different form
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 is not online. Last active: 7/24/2006 9:38:58 AM agenore



Top 10 Posts
Joined on 03-21-2006
Parma
Posts 26
Re: Different form
It is right!!! I'm a Idiot

   Report 
   04-30-2006, 10:39 PM
Yasir is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
Joined on 03-15-2006
Posts 44
Re: Different form
:P i have not said any thing.
   Report 
  Page 2 of 2 (21 items) « 1 2
Codersource.Net » Programming » MFC Programming » Different form

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us