存档

文章标签 ‘DLGINIT’
598 views

About DLGINIT in WTL

2010年7月5日

I’m using the wizard to load some static strings into a CComboBox.
When I run the app the strings aren’t visible.

Here’s what the link below says:

Initializing a Combo-Box
The ResourceView in VC++’s DevStudio allows entries in a combobox to be
added to the resource template at design time. When you add a combobox, and
bring up its properties page, then the “Data” tab is used to add entries.

When you run an MFC app and display dialogs with combo-boxes who have had
such entries defined, they are displayed with the combo-boxes populated as
expected. With WTL, the combo-boxes get displayed, but are empty. What is
happening?

Information about the combobox (such as its control id and location on the
dialog, but excluding its data entries) is stored as part of a resource, of
type DIALOG, in the resource file. The Win32 dialog APIs understand this and
load it directly before rendering the dialog. The information about the
entries in a combobox is stored as a separate resource, of type DLGINIT. The
Win32 dialog APIs do not understand DLGINIT. Other code in higher-level
libraries or the application itself has to process DLGINIT resources.

MFC provides functionality as part of its dialog classes to cater for
DLGINIT. WTL does not. The Clipcode Reuse Library contains a WTL-friendly
function called RUiDlgInit, which loads the DLGINIT data. It is modeled on
the equivalent MFC functionality.

RUiDlgInit(IDD, m_hWnd);

阅读全文…

WTL ,