Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Using ComCtl32 controls

I have a simple application, written in VC++ but not using MFC, which
displays a dialog using the DialogBox function (macro). This works fine
until I add any of the Common Controls to my dialog. When I do this, the
DialogBox call returns immediately (without showing the dialog) with a value
of -1 (indicating an error).

If I call GetLastError straight after this, it returns zero, which I believe
means that no error occurred.

Is there something I need to do in order to use the Common Controls within
my dialog?

My thanks in advance,
--

Adam.
[608 byte] By [Adam Dawes] at [2007-11-10 12:51:08]
# 1 Re: Using ComCtl32 controls
"Adam Dawes" <adam.dawes@editrack.nospam.com> wrote:
>I have a simple application, written in VC++ but not using MFC, which
>displays a dialog using the DialogBox function (macro). This works fine
>until I add any of the Common Controls to my dialog. When I do this, the
>DialogBox call returns immediately (without showing the dialog) with a value
>of -1 (indicating an error).
>
>If I call GetLastError straight after this, it returns zero, which I believe
>means that no error occurred.
>
>Is there something I need to do in order to use the Common Controls within
>my dialog?
>
>My thanks in advance,
>--
>

I think you are suffering a minor problem. You only have to call to InitCommonControls()
in the InitInstance, WinMain() or whatever other else function in your application
to initialize the common controls's DLLs and COM instances.

I guess it should serve as help

Best regards
Alberto Curro at 2007-11-11 20:41:57 >