ARX MFC

ARX MFC

Anonymous
Not applicable
358 Views
4 Replies
Message 1 of 5

ARX MFC

Anonymous
Not applicable
I have a dialog w/ multiple text fields, etc.

I want to populate the values.. but they are not initializing:

CDlgFixture dlgFixt;
dlgFixt.m_strFixtType.SetWindowText(strCkt); // a CEdit control

dlgFixt.m_cmbFixtureBlock.SetWindowText(temp); //a CComboBox ctrl

dlgFixt.UpdateData(false) // fails - unsupported operation?

dlgFixt.DoModal(); // shows, but w/o my values initialized.

??

Thanks,
MS
0 Likes
359 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Before declaring your instance of the dialog, add this line of code

CAcModuleResourceOverride resover;

The proper resources are not set, so the wrong dialog is being used, and
that control doesn't exist in that dialog hence the unsupported operation.

"Martin Schmid" wrote in message
news:F31F76A57E657BD58E145917AB9D7791@in.WebX.maYIadrTaRb...
> I have a dialog w/ multiple text fields, etc.
>
> I want to populate the values.. but they are not initializing:
>
> CDlgFixture dlgFixt;
> dlgFixt.m_strFixtType.SetWindowText(strCkt); // a CEdit control
>
> dlgFixt.m_cmbFixtureBlock.SetWindowText(temp); //a CComboBox ctrl
>
> dlgFixt.UpdateData(false) // fails - unsupported operation?
>
> dlgFixt.DoModal(); // shows, but w/o my values initialized.
>
> ??
>
> Thanks,
> MS
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Besides that you have to override the resource handle, it might also be the
call to
UpdateData(FALSE) before DoModal(). Before DoModal the Dialog is not
created, so there are no controls accessible.


"Randy Sanders" schrieb im Newsbeitrag
news:C642EE78F8386A58B77A63E05333470D@in.WebX.maYIadrTaRb...
> Before declaring your instance of the dialog, add this line of code
>
> CAcModuleResourceOverride resover;
>
> The proper resources are not set, so the wrong dialog is being used, and
> that control doesn't exist in that dialog hence the unsupported operation.
>
> "Martin Schmid" wrote in message
> news:F31F76A57E657BD58E145917AB9D7791@in.WebX.maYIadrTaRb...
> > I have a dialog w/ multiple text fields, etc.
> >
> > I want to populate the values.. but they are not initializing:
> >
> > CDlgFixture dlgFixt;
> > dlgFixt.m_strFixtType.SetWindowText(strCkt); // a CEdit control
> >
> > dlgFixt.m_cmbFixtureBlock.SetWindowText(temp); //a CComboBox ctrl
> >
> > dlgFixt.UpdateData(false) // fails - unsupported operation?
> >
> > dlgFixt.DoModal(); // shows, but w/o my values initialized.
> >
> > ??
> >
> > Thanks,
> > MS
> >
> >
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
It is the later... I need to do my initialization in OnInit, not prior to
calling DoModal.


"Andreas Mueller" wrote in message
news:2A630CF7F90FCB4B9CEF01AF9D6E0527@in.WebX.maYIadrTaRb...
> Besides that you have to override the resource handle, it might also be
the
> call to
> UpdateData(FALSE) before DoModal(). Before DoModal the Dialog is not
> created, so there are no controls accessible.
>
>
> "Randy Sanders" schrieb im Newsbeitrag
> news:C642EE78F8386A58B77A63E05333470D@in.WebX.maYIadrTaRb...
> > Before declaring your instance of the dialog, add this line of code
> >
> > CAcModuleResourceOverride resover;
> >
> > The proper resources are not set, so the wrong dialog is being used, and
> > that control doesn't exist in that dialog hence the unsupported
operation.
> >
> > "Martin Schmid" wrote in message
> > news:F31F76A57E657BD58E145917AB9D7791@in.WebX.maYIadrTaRb...
> > > I have a dialog w/ multiple text fields, etc.
> > >
> > > I want to populate the values.. but they are not initializing:
> > >
> > > CDlgFixture dlgFixt;
> > > dlgFixt.m_strFixtType.SetWindowText(strCkt); // a CEdit control
> > >
> > > dlgFixt.m_cmbFixtureBlock.SetWindowText(temp); //a CComboBox ctrl
> > >
> > > dlgFixt.UpdateData(false) // fails - unsupported operation?
> > >
> > > dlgFixt.DoModal(); // shows, but w/o my values initialized.
> > >
> > > ??
> > >
> > > Thanks,
> > > MS
> > >
> > >
> >
> >
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
> I want to populate the values.. but they are not initializing:

You can't set properties of controls before their windows have been
created. You'll need to either call CDialog::Create() manually (and handle
the dialog as a modeless dialog) before initializing controls, or do your
initializing in OnInitDialog(). The latter is simplest in most cases. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes