Re: multiple language support: dialog-boxes
On 19 Jun., 21:11, Joseph M. Newcomer <newco...@flounder.com> wrote:
See below...
On Sat, 19 Jun 2010 10:16:19 -0700 (PDT), mfc <mfcp...@googlemail.com> wr=
ote:
ok I`ve tried to add a demo modification in the OnUpdate() handler.
void CMLSampleView::OnUpdate(CView* pSender, LPARAM lHint, CObject*
pHint)
{
if(pSender == NULL)
return; //after startup oninitialupdate
****
erroneous. You do not care about the pSender
****
CButton * button = (CButton *)pSender->GetDlgItem(IDC_CHECK1);
****
Why do you not have a CButton variable here? Why did you not change th=
e silly IDC_CHECK1
name to something meaningful? The above line should be finely ground a=
nd buried in a
toxic waste site.
*****> UINT test = button->GetCheck();
if(button->GetCheck() == BST_CHECKED)
****
Why do you get the value, then get it again?
*****> TRACE("checked\n");
CView::OnUpdate (pSender, lHint, pHint);
****
You only call this if lHint == 0 && pHint == NULL. Otherwise, =
you obey the request of
your lHint.
*****
}
It`s only a small demo - I already know that GetDlgItem is not the
best solution as well as the general id - but it should only help me
to get an idea.... of how it could / should work...
Moreover all checkboxes or other information from the dialog has to be
checked and stored in private variables in the view-class?? And loaded
to the new language dialog box?
Therefore I added following lines to the code above
CDocument *pDoc = pOldView->GetDocument();
pDoc->AddView(m_pNewView);
pDoc->UpdateAllViews(pOldView);
So there`s first of all the old-view loaded (and the onupdate-method
for this oldview to store all these information) - and after that the
new view OnUpdate()-method is loaded to get these information back
from the private variables from the document...
Joseph M. Newcomer [MVP]
email: newco...@flounder.com
Web:http://www.flounder.com
MVP Tips:http://www.flounder.com/mvp_tips.htm- Zitierten Text ausblenden =
-
- Zitierten Text anzeigen -
do you mean this example from the msdn?
http://msdn.microsoft.com/en-us/library/s199bks0(VS.80).aspx
Unfortunately, I can`t open this collect programm in vs2010.