PlaySound unresolved symbol
Can't seem to get PlaySound to work. I thought I had all the correct includes. I added WINMM.LIB to my project. What is causing these errors?
Code:
// Wintest.cpp : Defines the entry point for the application.
//
#define WIN32_LEAN_AND_MEAN //simple win32 app no mfc
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h> // very important and include WINMM.LIB too!
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "stdafx.h"
#include "resource.h"
#define WINDOW_CLASS_NAME "WINCLASS1"
HWND main_window_handle = NULL; // globally track main window
HINSTANCE hinstance_app = NULL; // globally track hinstance
//main message handler
LRESULT CALLBACK WindowProc(HWND hwnd,
UINT msg,
WPARAM wparam,
LPARAM lparam)
{
PAINTSTRUCT ps; // used in WM_PAINT
HDC hdc; // handle to device context
// handle message
switch(msg)
{
case WM_CREATE:{
PlaySound(MAKEINTRESOURCE(SOUND_ID_INTRO),hInstance_app,
SND_ASYNC|SND_RESOURCE);
return(0);
}
break;
.
.
.
Wintest.cpp
C:\Documents and Settings\ripspinner\My Documents\VisC++6Source\Wintest\Wintest.cpp(33) : error C2065: 'PlaySound' : undeclared identifier
C:\Documents and Settings\ripspinner\My Documents\VisC++6Source\Wintest\Wintest.cpp(33) : error C2065: 'hInstance_app' : undeclared identifier
C:\Documents and Settings\ripspinner\My Documents\VisC++6Source\Wintest\Wintest.cpp(34) : error C2065: 'SND_ASYNC' : undeclared identifier
C:\Documents and Settings\ripspinner\My Documents\VisC++6Source\Wintest\Wintest.cpp(34) : error C2065: 'SND_RESOURCE' : undeclared identifier
Error executing cl.exe.
Wintest.exe - 4 error(s), 0 warning(s)