windows sdk编程遇到奇怪的问题

用windows sdk编写应用程序遇到一个奇怪的问题:当代码如下时,
                case IDC_BUTTON_GETPID:
                {
                    MessageBox(NULL, "aaa", "aaa", MB_OK);
                    。。。。。。。。。。
                }
                return TRUE;

                case IDC_BUTTON_BROWSER:
                {
                    OPENFILENAME ofn;
                    TCHAR szFile[MAX_PATH] = {0};
                   
                    memset(&ofn, 0, sizeof(OPENFILENAME));
                    ofn.lStructSize = sizeof(OPENFILENAME);
                    ofn.hwndOwner = hDlg;
                    ofn.lpstrFile = szFile;
                    ofn.nMaxFile = MAX_PATH;
                    ofn.lpstrFilter = _T("*.*");
                    ofn.lpstrDefExt = _T("*");
                    ofn.lpstrTitle = _T("选择文件");

                    ofn.nFilterIndex = 1;
                    ofn.lpstrFileTitle = NULL;
                    ofn.nMaxFileTitle = 0;
                    ofn.lpstrInitialDir = NULL;

                    if(GetOpenFileName(&ofn)) {
                        SetWindowText(openedfileEdit, _T(""));
                        SetWindowText(pidEdit, _T(""));
                        SetWindowText(openedfileEdit, szFile);
                        EnableWindow(pidEdit, TRUE);
                        EnableWindow(pidBtn, TRUE);
                    }
                }
                return TRUE;

获取文件对话框时,对话框里没有文件显示,只有文件夹。这很奇怪。

而当代码如下时:

                case IDC_BUTTON_BROWSER:
                {
                    OPENFILENAME ofn;
                    TCHAR szFile[MAX_PATH] = {0};
                   
                    memset(&ofn, 0, sizeof(OPENFILENAME));
                    ofn.lStructSize = sizeof(OPENFILENAME);
                    ofn.hwndOwner = hDlg;
                    ofn.lpstrFile = szFile;
                    ofn.nMaxFile = MAX_PATH;
                    ofn.lpstrFilter = _T("*.*");
                    ofn.lpstrDefExt = _T("*");
                    ofn.lpstrTitle = _T("选择文件");

                    ofn.nFilterIndex = 1;
                    ofn.lpstrFileTitle = NULL;
                    ofn.nMaxFileTitle = 0;
                    ofn.lpstrInitialDir = NULL;

                    if(GetOpenFileName(&ofn)) {
                        SetWindowText(openedfileEdit, _T(""));
                        SetWindowText(pidEdit, _T(""));
                        SetWindowText(openedfileEdit, szFile);
                        EnableWindow(pidEdit, TRUE);
                        EnableWindow(pidBtn, TRUE);
                    }
                }
                return TRUE;
                case IDC_BUTTON_GETPID:
                {
                    MessageBox(NULL, "aaa", "aaa", MB_OK);
                    。。。。。。。。。。
                }
                return TRUE;

获取文件对话框,对话框里有文件实现。具体导致这种问题并不清楚,不过调式信息发现,上面比下面多了些调式信息

/system32/shimgvw.dll', no matching symbolic information found.
Loaded 'C:/WINDOWS/system32/ntmarta.dll', no matching symbolic information found.
Loaded 'C:/WINDOWS/system32/samlib.dll', no matching symbolic information found.
The thread 0x614 has exited with code 1 (0x1).
The thread 0xDC8 has exited with code 1 (0x1).
The thread 0x5A4 has exited with code 1 (0x1).
The thread 0x8F4 has exited with code 1 (0x1).
The thread 0xE84 has exited with code 1 (0x1).

我想是不是程序在哪里堵住了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值