Author Topic: C::B_5859 - minGW - commctrls  (Read 5324 times)

Offline Newling

  • Multiple posting newcomer
  • *
  • Posts: 17
C::B_5859 - minGW - commctrls
« on: October 18, 2009, 07:27:48 pm »
Hello to everyone!

I'm just new with code block and have the following question:
   
I created a few projects and they all work normally
but I have problems when I use a trackbar.
The dialog is not displayed, the program will be terminated immediately,
and I can not embed this code :
Code
    INITCOMMONCONTROLSEX ICC;

    ICC.dwSize = sizeof(ICC);
    ICC.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(ICC);
||=== TrackBar, Debug ===|
X:\TrackBar\main.cpp||In function 'int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':|
X:\TrackBar\main.cpp|42|error: 'INITCOMMONCONTROLSEX' was not declared in this scope|
X:\TrackBar\main.cpp|42|error: expected ';' before 'ICC'|
X:\TrackBar\main.cpp|44|error: 'ICC' was not declared in this scope|
X:\TrackBar\main.cpp|46|error: 'InitCommonControlsEx' was not declared in this scope|
||=== Erstellen beendet: 4 Fehler, 0 Warnungen===|

Code
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <commctrl.h>
#include "resource.h"


HINSTANCE hInst;

BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch(uMsg)
    {
    case WM_INITDIALOG:
        return TRUE;

    case WM_CLOSE:
        EndDialog(hwndDlg, 0);
        return TRUE;

    case WM_LBUTTONDOWN:
        SendMessage(hwndDlg, WM_CLOSE, 0, 0);
        return TRUE;

    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
            //Button schliessen
        case IDC_cmdSchliessen:
            SendMessage(hwndDlg,WM_CLOSE,0,0);
            return TRUE;
        }
    }

    return FALSE;
}


int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{

    INITCOMMONCONTROLSEX ICC;

    ICC.dwSize = sizeof(ICC);
    ICC.dwICC = ICC_WIN95_CLASSES;
    InitCommonControlsEx(ICC);

    hInst = hInstance;

    // The user interface is a modal dialog box
    return DialogBox(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, DialogProc);

Can someone tell me how I can incorporate these controls?

Thanks!

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B_5859 - minGW - commctrls
« Reply #1 on: October 18, 2009, 08:13:01 pm »
Can someone tell me how I can incorporate these controls?
Sorry, this is in no way Code::Blocks related and thus violates our forum rules. Please try a C/C++/MFC programmer forum.

Topic locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ