2 qq 33546703 qq_33546703 于 2016.05.10 15:54 提问

MCIWndcreate()使用导致卡死失去响应

我创建了一个窗口,但切换或者点击就会卡死失去响应,求大神解答

4个回答

oyljerry
oyljerry   Ds   Rxr 2016.05.10 16:47

先看看具体出错的代码位置,然后看是否参数等有问题

qq_33546703
qq_33546703 你帮我看一下,我弄了两天还没有找到错误
一年多之前 回复
qq_33546703
qq_33546703   2016.05.10 19:14

#include
#include
#include "Vfw.h"
#include

#pragma comment (lib, "VFW32.lib")
#pragma comment(lib,"Winmm.lib")

int main()
{
initgraph(960, 640);

HINSTANCE hin = (HINSTANCE)GetModuleHandle(NULL);
HWND hwnd = GetHWnd();
HWND hw = MCIWndCreate(hwnd, hin,  WS_CHILD, "start.wmv");
MCIWndNew(hw, "waveaudio");
MCIWndOpen(hw, "start.wmv", 0);
::MoveWindow(hw, 0, 0, 960, 760, TRUE);
MCIWndPlay(hw);
int i = 0;
while (i <= 22)
{
    Sleep(1000);
    if (kbhit())
    {
        exit(0);
    }
    i++;
}
MCIWndClose(hw);
getch();
closegraph();

}

qq_33546703
qq_33546703   2016.05.10 19:14

#include
#include
#include "Vfw.h"
#include

#pragma comment (lib, "VFW32.lib")
#pragma comment(lib,"Winmm.lib")

int main()
{
initgraph(960, 640);

HINSTANCE hin = (HINSTANCE)GetModuleHandle(NULL);
HWND hwnd = GetHWnd();
HWND hw = MCIWndCreate(hwnd, hin,  WS_CHILD, "start.wmv");
MCIWndNew(hw, "waveaudio");
MCIWndOpen(hw, "start.wmv", 0);
::MoveWindow(hw, 0, 0, 960, 760, TRUE);
MCIWndPlay(hw);
int i = 0;
while (i <= 22)
{
    Sleep(1000);
    if (kbhit())
    {
        exit(0);
    }
    i++;
}
MCIWndClose(hw);
getch();
closegraph();

}

qq_33546703
qq_33546703   2016.05.10 19:17
#include<conio.h>
#include "Vfw.h"
#include<WinUser.h>

#pragma comment (lib, "VFW32.lib")
#pragma comment(lib,"Winmm.lib")

int main()
{
    initgraph(960, 640);

    HINSTANCE hin = (HINSTANCE)GetModuleHandle(NULL);
    HWND hwnd = GetHWnd();
    HWND hw = MCIWndCreate(hwnd, hin,  WS_CHILD, "start.wmv");
    MCIWndNew(hw, "waveaudio");
    MCIWndOpen(hw, "start.wmv", 0);
    ::MoveWindow(hw, 0, 0, 960, 760, TRUE);
    MCIWndPlay(hw);
    int i = 0;
    while (i <= 22)
    {
        Sleep(1000);
        if (kbhit())
        {
            exit(0);
        }
        i++;
    }
    MCIWndClose(hw);
    getch();
    closegraph();

}


Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!