Controls in MFC

Discussion in 'MFC' started by pord911, Feb 9, 2011.

  1. pord911

    pord911 New Member

    Joined:
    Feb 8, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I have a question, I'm working on a MFC assigment and I encountered on a problem,and fixed it after spending houres searching the internet and thinking . Here is what the problem was, my project was working fine but when I would close it a run time check error ocures saying "stack around InitCtrls variable was corrupted", variable InitCtrls is defined

    1. INITCOMMONCONTROLSEX InitCtrls;
    2. InitCtrls.dwSize = sizeof(InitCtrls);

    3. InitCtrls.dwICC = ICC_STANDARD_CLASSES;
    4. InitCommonControlsEx(&InitCtrls);
    Now I know that when this error ocures that there isn't enough memory for some variable
    example:

    int a[4];
    a[5]=25; //stack over variable a corrupted

    In my problem the line 3. was defined like this
    InitCtrls.dwICC =ICC_WIN95_CLASSES;

    and when I changed it to

    InitCtrls.dwICC = ICC_STANDARD_CLASSES;

    the problem was fixed. Finnaly my question is how does changing the code in line 3. relate with the simple example showed above? what do ICC_WIN95_CLASSES,ICC_STANDARD_CLASSES mean?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice