Click here to Skip to main content
15,902,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Custom Appwizard help Pin
YaronNir22-Jun-03 1:35
YaronNir22-Jun-03 1:35 
Generalchanging the background color of CEdit Pin
YanivNahum21-Jun-03 21:48
YanivNahum21-Jun-03 21:48 
GeneralRe: changing the background color of CEdit Pin
Ryan Binns21-Jun-03 22:55
Ryan Binns21-Jun-03 22:55 
GeneralRe: changing the background color of CEdit Pin
Brian Delahunty22-Jun-03 0:45
Brian Delahunty22-Jun-03 0:45 
QuestionHow Can i control net connection? Pin
zhangyifei21-Jun-03 19:56
zhangyifei21-Jun-03 19:56 
AnswerRe: How Can i control net connection? Pin
YanivNahum21-Jun-03 21:45
YanivNahum21-Jun-03 21:45 
GeneralRe: How Can i control net connection? Pin
zhangyifei22-Jun-03 3:57
zhangyifei22-Jun-03 3:57 
GeneralAdding view(s) to the view list of a document Pin
pdunn21-Jun-03 18:59
pdunn21-Jun-03 18:59 
I need help with adding a view(s) to the document view list.
I know that CDocument::AddView() will add the view to the view list. The CView::OnCreate() is suppose to call the AddView(), but I don't have an OnCreate, I have Create() in my SecondView class. My FirstView does get adding to the view list. There is a difference in my second view (SecondView) than in my first view (FirstView). FirstView uses a PreCreateWindow(cs) method and my SecondView uses a Create(...) method. In the PreCreateWindow(cs) method, CListView::PreCreateWindow(cs) is called. In my Create method the first few lines of code is

if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle | WS_CLIPCHILDREN,
rect, pParentWnd, nID, pContext))
{
return FALSE;
}

it does not call the base class CFormView::Create(...), I have tried that and got an error.

In my CWinApp derived class I have the method
LoadFrames(){
m_pSecondView->OpenDocumentFile(NULL);
m_pFirstView->OpenDocumentFile(NULL);
}

m_pSecondView and m_pFirstView are CMultiDocTemplate* type.

When I use the following in another method in my CWinApp derived class
pos = m_pSecondView->GetFirstDocPosition();
pDoc = m_pSeconView->GetNextDoc(pos);
pDoc will equal the correct class (CMyDoc)

However, in my CMyDoc file

pos = pDoc->GetFirstViewPosition();
CView* prog;
while(pos != NULL)
{
prog = pDoc->GetNextView(pos);
if(prog->IsKindOf(RUNTIME_CLASS(CSecondView)))
((CSecondView*)prog)->Method(m_nVar);
}

The only view prog ever get populated with is CFirstView.
Also in my CWinApp derived class, I use the line
CDocument* pDoc = pChild->GetActiveDocument();
and found out (when pChild = CSecondFrame [see next paragraph]) pDoc will be set to NULL 0x000000.

If it is important I have defined the CMultiDocTemplate pointers as such
m_pFirstView = new CMultiDocTemplate(IDR_FIRSTTYPE,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CFirstView));
AddDocTemplate(m_pFirstView);

m_pSecondView = new CMultiDocTemplate(IDR_SECONDTYPE,
RUNTIME_CLASS(CMYDoc),
RUNTIME_CLASS(CSecondFrame),
RUNTIME_CLASS(CSecondView));
AddDocTemplate(m_pSecondView);

as you will notice, two different frames and IDRs are used. I don't believe that should make a difference in regards to the CMyDoc class, but I am writing all that could be revelant.

The information that I need is, how do I get my SecondView associated in the view list of my MyDoc class.

Thank you for any help.
Questionhow can i do? Pin
jing_cao21-Jun-03 15:46
jing_cao21-Jun-03 15:46 
QuestionVC++ Standard ED final .exe program? Pin
DaveE9th21-Jun-03 15:00
DaveE9th21-Jun-03 15:00 
AnswerRe: VC++ Standard ED final .exe program? Pin
Michael Dunn21-Jun-03 17:51
sitebuilderMichael Dunn21-Jun-03 17:51 
GeneralRe: VC++ Standard ED final .exe program? Pin
DaveE9th21-Jun-03 22:27
DaveE9th21-Jun-03 22:27 
GeneralRe: VC++ Standard ED final .exe program? Pin
Ryan Binns21-Jun-03 22:51
Ryan Binns21-Jun-03 22:51 
AnswerRe: VC++ Standard ED final .exe program? Pin
Rick Crone26-Jun-03 10:47
Rick Crone26-Jun-03 10:47 
GeneralTranslate a code snippet from Delphi to C++ Pin
raven200321-Jun-03 14:29
raven200321-Jun-03 14:29 
GeneralRe: Translate a code snippet from Delphi to C++ Pin
Andrew Walker21-Jun-03 18:53
Andrew Walker21-Jun-03 18:53 
GeneralGenesis 3D engine and Visual C++ Pin
DaveE9th21-Jun-03 14:23
DaveE9th21-Jun-03 14:23 
GeneralRe: Genesis 3D engine and Visual C++ Pin
Anonymous21-Jun-03 17:57
Anonymous21-Jun-03 17:57 
GeneralRe: Genesis 3D engine and Visual C++ Pin
Scozturk21-Jun-03 21:48
professionalScozturk21-Jun-03 21:48 
GeneralClueless about regexp groups & captures Pin
Tom Archer21-Jun-03 12:16
Tom Archer21-Jun-03 12:16 
GeneralRe: Clueless about regexp groups & captures Pin
Michael Dunn21-Jun-03 18:04
sitebuilderMichael Dunn21-Jun-03 18:04 
GeneralRe: Clueless about regexp groups & captures Pin
Tom Archer21-Jun-03 18:45
Tom Archer21-Jun-03 18:45 
GeneralRe: Clueless about regexp groups & captures Pin
Brian Delahunty22-Jun-03 0:48
Brian Delahunty22-Jun-03 0:48 
GeneralRe: Clueless about regexp groups & captures Pin
Tom Archer22-Jun-03 3:37
Tom Archer22-Jun-03 3:37 
GeneralRe: Clueless about regexp groups & captures Pin
Brian Delahunty22-Jun-03 3:54
Brian Delahunty22-Jun-03 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.