@w_gower: "What is the Microsoft official pronouncement on the populating the controls
of a dialog box prior to the user seeing it?  In the class that calls the
dialog box before the DoModal or pass an object with the data in it to the
Constructor.  I have done it the first way but the problem is accessing
controls like a ComboBox to set the current selection."
    @ajaykalra: "You can initialize/subclass your controls in OnInitDialog of your dialog.
Ajay Kalra [MVP - VC++]
<email_address>
news:u0l$<email_address>
<quote>
controls"
    @bobm: "<quote>
You can't modify the controls themselves before the DoModal because
they don't exist at that point. You may have modified DDX variables,
but that's not the same as setting the controls.
As Ajay points out, the canonical place to access a dialog's controls
prior to it becoming visible is the WM_INITDIALOG handler. At this
point the controls exist and can be accessed - that's what the message
is for.
Bob Moore [WinSDK MVP]
<url>
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
    @w_gower: "So I should populate an object with my data from the recordset and pass the
object to the dialog box in the constructor and in the initdialog populate
the controls?
news:<email_address>
<quote>
controls
the"
    @ajaykalra: "Thats one way to do it(you would pass the object pointer in the constructor)
or you can have a Singleton ObjectManager which your dialog can call to get
the current recordset etc.
Ajay Kalra [MVP - VC++]
<email_address>
news:<email_address>
<quote>
the
the"
    @bobm: "<quote>
That would be my preferred solution - access the data at the point you
need the data. Easier to understand, and therefore easier to maintain.
Bob Moore [WinSDK MVP]
<url>
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
{'source': 'USENET', 'other_information': '{"reply_count": 5, "forum_name": "microsoft.public.vc.mfc.20140611.mbox"}', 'file': 'data/output/usenet-microsoft.public.parquet'}