为什么运行不了呢?
#include "stdafx.h"#include <stdio.h>
#include <windows.h>
#include <mmsystem.h>
#include <windowsx.h>
#include "resource.h"
#include "MainDlg.h"
BOOL WINAPI Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
HANDLE_MSG(hWnd, WM_INITDIALOG, Main_OnInitDialog);
HANDLE_MSG(hWnd, WM_COMMAND, Main_OnCommand);
HANDLE_MSG(hWnd,WM_CLOSE, Main_OnClose);
}
return FALSE;
}
BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
return TRUE;
}
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
switch(id)
{
case IDC_OK:
{
mciSendString( TEXT("open d:/1.mp3 alias MySong"), NULL, 0, NULL );
mciSendString( TEXT("play MySong"), "", 0, NULL );
}
break;
default:
break;
}
}
void Main_OnClose(HWND hwnd)
{
EndDialog(hwnd, 0);
}
--------------------Configuration: MusicPlay - Win32 Debug--------------------
Compiling...
MainDlg.cpp
Linking...
MainDlg.obj : error LNK2001: unresolved external symbol __imp__mciSendStringA@16
Debug/MusicPlay.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
Creating browse info file...
MusicPlay.exe - 1 error(s), 0 warning(s)