Win32界面程序无法启动问题

使用Win C生成界面程序时. 由于CreateWindow使用了错误的参数, 导致无法创建窗体.

 

    wndclass.lpszClassName = szClassName; // 这里是类名设置

    if(!RegisterClass(&wndclass))
    {
        //  error 发生错误.
        return -1;
    }

    /////////////////////////////////////////////////////////////
    ////  Create the window and display it (if iCmdShow says so)
    /////////////////////////////////////////////////////////////
    int x = CW_USEDEFAULT;
    hwnd = CreateWindow(
        szClassName,             // 这里需要输入类名, 要求与前面的类名保持一致.
        TEXT("Draw Surface"),
        WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT,
        CW_USEDEFAULT, CW_USEDEFAULT,
        NULL, NULL, hInstance, NULL);

 要求注册时的类名与CreateWindo的参数1一致,(行1 & 行14)

上一篇:poj 2186 (强连通分支)


下一篇:入门练习-1