Ciao a tutti,

questa volta ho questo problema...

ho creato un nuovo progetto Windows Application con Dev-C++
ho creato i pulsanti e tutto il resto...

Il codice stranamente ogni tanto funziona, ogni tanto va in crash appena premo il pulsante ed altre volte invece di eseguire l'addizione mi scrive solamente il valore del secondo campo textbox

codice:
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                  /* handle the messages */
    {
           case WM_CREATE:
                
                CreateWindow(TEXT("button"),TEXT("Hello"), WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON , 60,80,100,25, hwnd, (HMENU) 1, NULL , NULL);
                CreateWindow(TEXT("edit"),TEXT("0"), WS_TABSTOP | WS_VISIBLE | WS_CHILD  , 10,10,100,20, hwnd, (HMENU) 2, NULL , NULL);
                CreateWindow(TEXT("edit"),TEXT("0"), WS_TABSTOP | WS_VISIBLE | WS_CHILD , 120,10,100,20, hwnd, (HMENU) 3, NULL , NULL);
                CreateWindow(TEXT("edit"),TEXT("0"), WS_TABSTOP | WS_VISIBLE | WS_CHILD , 60,40,100,20, hwnd, (HMENU) 4, NULL , NULL);
                
                break;
                
                case WM_COMMAND:
                     
                     switch(LOWORD(wParam)) {
                                            
                                       case 1:
                                            
                                       char* a; char* b;
                                       
                                       GetWindowText(GetDlgItem(hwnd,2), a , 256 );
                                       GetWindowText(GetDlgItem(hwnd,3), b , 256 );
                                       
                                       int aV = conv.FromCharToInt(a);
                                       int bV = conv.FromCharToInt(b);
                                       int x = aV + bV;
                                       
                                       SetWindowText(GetDlgItem(hwnd,4), conv.FromIntToConstChar(bV) );
                                       
                                       break;
                                }
                     break;
        case WM_DESTROY:
            PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
            break;
        default:                      /* for messages that we don't deal with */
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;
}
il codice del FromCharToInt è questo:

codice:
             int FromCharToInt(char* input)
             {
               int output = atoi(input);
               return output;   
             }
Ho provato a visualizzare ogni variabile (aV e bV) per volta e sembra che quasi sempre aV non venga letta.