Click here to Skip to main content
15,903,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: To convert a DAT file to a BMP file Pin
Code-o-mat1-Nov-09 3:46
Code-o-mat1-Nov-09 3:46 
Questionconvert md5 values to decimal Pin
nuttynibbles31-Oct-09 20:14
nuttynibbles31-Oct-09 20:14 
AnswerRe: convert md5 values to decimal Pin
CPallini31-Oct-09 21:20
mveCPallini31-Oct-09 21:20 
Questionreverse division to convert decimals to dinary Pin
Omegaclass31-Oct-09 19:57
Omegaclass31-Oct-09 19:57 
AnswerRe: reverse division to convert decimals to dinary Pin
CPallini31-Oct-09 21:04
mveCPallini31-Oct-09 21:04 
GeneralRe: reverse division to convert decimals to dinary Pin
Omegaclass31-Oct-09 21:36
Omegaclass31-Oct-09 21:36 
GeneralRe: reverse division to convert decimals to dinary Pin
CPallini1-Nov-09 6:32
mveCPallini1-Nov-09 6:32 
GeneralRe: reverse division to convert decimals to dinary Pin
Omegaclass1-Nov-09 10:10
Omegaclass1-Nov-09 10:10 
GeneralRe: reverse division to convert decimals to dinary Pin
CPallini1-Nov-09 10:13
mveCPallini1-Nov-09 10:13 
GeneralRe: reverse division to convert decimals to dinary Pin
Omegaclass1-Nov-09 12:28
Omegaclass1-Nov-09 12:28 
AnswerRe: reverse division to convert decimals to dinary Pin
David Crow2-Nov-09 4:08
David Crow2-Nov-09 4:08 
GeneralRe: reverse division to convert decimals to dinary Pin
Omegaclass2-Nov-09 17:15
Omegaclass2-Nov-09 17:15 
QuestionRe: reverse division to convert decimals to dinary Pin
David Crow3-Nov-09 2:44
David Crow3-Nov-09 2:44 
AnswerRe: reverse division to convert decimals to dinary Pin
Omegaclass3-Nov-09 19:08
Omegaclass3-Nov-09 19:08 
QuestionUgly Numbers Error Pin
anollipian31-Oct-09 14:21
anollipian31-Oct-09 14:21 
AnswerRe: Ugly Numbers Error Pin
LunaticFringe31-Oct-09 14:30
LunaticFringe31-Oct-09 14:30 
GeneralRe: Ugly Numbers Error Pin
anollipian31-Oct-09 14:44
anollipian31-Oct-09 14:44 
GeneralRe: Ugly Numbers Error Pin
Luc Pattyn1-Nov-09 3:59
sitebuilderLuc Pattyn1-Nov-09 3:59 
QuestionRe: Ugly Numbers Error Pin
David Crow31-Oct-09 16:26
David Crow31-Oct-09 16:26 
Question2 Errors Pin
MrMcIntyre31-Oct-09 6:09
MrMcIntyre31-Oct-09 6:09 
AnswerRe: 2 Errors Pin
Chris Losinger31-Oct-09 6:10
professionalChris Losinger31-Oct-09 6:10 
AnswerRe: 2 Errors Pin
enhzflep31-Oct-09 6:17
enhzflep31-Oct-09 6:17 
GeneralRe: 2 Errors Pin
MrMcIntyre31-Oct-09 6:25
MrMcIntyre31-Oct-09 6:25 
GeneralRe: 2 Errors Pin
enhzflep31-Oct-09 6:36
enhzflep31-Oct-09 6:36 
Sure thing.

There's actually another one that neither of us mentioned yet too - you mean WM_DESTROY, not WM_DESTORY

Substitute part of your code for this:

    while (1)
    {
        if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            if (msg.message == WM_QUIT)
                TranslateMessage(&msg);
            DispatchMessage(&msg);
        }
    }
    return (int) msg.wParam;
}
//Callback Function (WindowEvent)
LRESULT CALLBACK WindowEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        break;
    }
    return DefWindowProc(hWnd, message, wParam, lParam);
}


There's other things amiss too, though this will give you a window that opens.
GeneralRe: 2 Errors Pin
MrMcIntyre31-Oct-09 6:40
MrMcIntyre31-Oct-09 6:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.