15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


How to intialize data fields in a class derived from CFormVi

Anujit Sarkar -- anujit@vedika.ernet.in
Wednesday, July 24, 1996

Environment:MSVC 4.1,Win95

I have created a SDI application.It may have different views during
program execution but only one of them exists at any point of time.
I am using CFrameWnd::CreateView(...) to create the views.
//Code snippet
CView* prevView=GetActiveView();
prevView->DestroyWindow();
CWnd* curView=NULL;

CCreateContext localCCreateContext;
localCCreateContext.m_pCurrentFrame=this;
   
localCCreateContext.m_pNewViewClass=RUNTIME_CLASS(CQueryView);
//
if (!(curView=CreateView(&localCCreateContext)))
{
    TRACE0("Failed to create new view\n");
    return ;
}

// activate the input view
   RecalcLayout();
        
   SetActiveView((CView*)curView);

All the views are subclasses of CView or CFormView.But the
views which are derived from CFormView contains combo,listbox and
listcontrols which need to be initialized by filling them with
required items.I cannot initialize them in OnInitialUpdate as this
is only a one-time initialization method that gets called only
once.Where can I do the initialization?

Thanks in advance

-------------------------------------------------------------------
Anujit Sarkar(e-mail address:anujit@vedika.ernet.in)
-------------------------------------------------------------------
Resi: 102 Southern Avenue        Office:Vedika International
      'Sarobar' 7  N.E.                 21 Lansdowne Court
      Calcutta -700029                  5B Sarat Bose Road
      INDIA                             Calcutta-700020 INDIA
      Phone No.+91-33-4661473           Phone No.+91-33-2473810
-------------------------------------------------------------------



S.A.C. Madrid -- sacmad2@ibm.net
Tuesday, August 13, 1996

>Environment:MSVC 4.1,Win95
>
>I have created a SDI application.It may have different views during
>program execution but only one of them exists at any point of time.
>I am using CFrameWnd::CreateView(...) to create the views.
>//Code snippet
>CView* prevView=GetActiveView();
>prevView->DestroyWindow();
>CWnd* curView=NULL;
>
>CCreateContext localCCreateContext;
>localCCreateContext.m_pCurrentFrame=this;
>   
>localCCreateContext.m_pNewViewClass=RUNTIME_CLASS(CQueryView);
>//
>if (!(curView=CreateView(&localCCreateContext)))
>{
>    TRACE0("Failed to create new view\n");
>    return ;
>}
>
>// activate the input view
>   RecalcLayout();
>        
>   SetActiveView((CView*)curView);
>
>All the views are subclasses of CView or CFormView.But the
>views which are derived from CFormView contains combo,listbox and
>listcontrols which need to be initialized by filling them with
>required items.I cannot initialize them in OnInitialUpdate as this
>is only a one-time initialization method that gets called only
>once.Where can I do the initialization?
>
>Thanks in advance
>
>-------------------------------------------------------------------
>Anujit Sarkar(e-mail address:anujit@vedika.ernet.in)
>-------------------------------------------------------------------
>Resi: 102 Southern Avenue        Office:Vedika International
>      'Sarobar' 7  N.E.                 21 Lansdowne Court
>      Calcutta -700029                  5B Sarat Bose Road
>      INDIA                             Calcutta-700020 INDIA
>      Phone No.+91-33-4661473           Phone No.+91-33-2473810
>-------------------------------------------------------------------
>
>

Try to set initial value with the message OnActivateView is hard but works.
Pedro



S.A.C. Madrid -- sacmad2@ibm.net
Tuesday, August 13, 1996

>Environment:MSVC 4.1,Win95
>
>I have created a SDI application.It may have different views during
>program execution but only one of them exists at any point of time.
>I am using CFrameWnd::CreateView(...) to create the views.
>//Code snippet
>CView* prevView=GetActiveView();
>prevView->DestroyWindow();
>CWnd* curView=NULL;
>
>CCreateContext localCCreateContext;
>localCCreateContext.m_pCurrentFrame=this;
>   
>localCCreateContext.m_pNewViewClass=RUNTIME_CLASS(CQueryView);
>//
>if (!(curView=CreateView(&localCCreateContext)))
>{
>    TRACE0("Failed to create new view\n");
>    return ;
>}
>
>// activate the input view
>   RecalcLayout();
>        
>   SetActiveView((CView*)curView);
>
>All the views are subclasses of CView or CFormView.But the
>views which are derived from CFormView contains combo,listbox and
>listcontrols which need to be initialized by filling them with
>required items.I cannot initialize them in OnInitialUpdate as this
>is only a one-time initialization method that gets called only
>once.Where can I do the initialization?
>
>Thanks in advance
>
>-------------------------------------------------------------------
>Anujit Sarkar(e-mail address:anujit@vedika.ernet.in)
>-------------------------------------------------------------------
>Resi: 102 Southern Avenue        Office:Vedika International
>      'Sarobar' 7  N.E.                 21 Lansdowne Court
>      Calcutta -700029                  5B Sarat Bose Road
>      INDIA                             Calcutta-700020 INDIA
>      Phone No.+91-33-4661473           Phone No.+91-33-2473810
>-------------------------------------------------------------------
>
>

Try to set initial value with the message OnActivateView is hard but works.
Pedro




| Вернуться в корень Архива |