www.digitalmars.com         C & C++   DMDScript  

c++.mfc - mmsystem.h problems

reply marc teichtahl <marc_member pathlink.com> writes:
Hi All,

I am trying to work with multimedia timers in a MFC based application.

I am including mmsystem.h in my class header

#ifndef __EVOL_CLOCK__
#define __EVOL_CLOCK__
#include <windows.h>

#include <mmsystem.h>
#include "evolDefs.h"
#include "evolClockCallback.h"
#include "evolArray.h"

#define CLOCK_RESOLUTION 1    // 1ms intervals

class evolClock
{
public:
evolClock();
virtual ~evolClock();
UINT    registerEvolCallback(evolClockCallback* func);
UINT    unRegisterEvolCallback(EVOL_CLOCK_HANDLE handle);
UINT    startClock(EVOL_CLOCK_HANDLE handle);
UINT    stopClock(EVOL_CLOCK_HANDLE handle);
protected:
UINT        clockCounter;
evolArray<evolClockCallback*> clocks; }; #endif //__EVOL_CLOCK__

However, when compiling I get the following error

Program Files\dm\bin\sc.EXE -cpp -Ae -mn -C -o+time -D_WINDOWS -ff -Pz -S -3 -a8
-c -gf -D_CONSOLE=1 -D_DEBUG=1 -D_X86_=1 -D_MT=1 -D_WIN32=1 -D_MBCS=1
-oevolution.obj evolution.cpp Program Files\dm\bin\scpp.EXE -cpp -Ae -mn -C
+time -D_WINDOWS -ff -Pz -S -3 -a8 -gf -D_CONSOLE=1 -D_DEBUG=1 -D_X86_=1 -D_MT=1
-D_WIN32=1 -D_MBCS=1 evolution.cpp -oevolution.obj
Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(358): parameter list
is out of context
Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(363): ')' expected to
close function parameter list with
Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(406): ')' expected
Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(441): 'sndPlaySoundW'
is not in function parameter list Fatal Error: C:\PROGRAM
FILES\DM\BIN\..\include\win32\MMSYSTEM.H(487): too many errors Lines Processed:
81717  Errors: 5  Warnings: 0 Build failed

Im wondering if someone would be good enough to assist me is solvong this
problem ? I have run out of ideas myself and I now look to some more
knowledgeable people to help me

Thanks in advance

Marc Teichtahl


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 4/14/2005


thanks again
Apr 16 2005
parent Arjan Knepper <arjan ask.me> writes:
marc teichtahl wrote:

 Hi All,
 
 I am trying to work with multimedia timers in a MFC based application.
 
 I am including mmsystem.h in my class header
 
 #ifndef __EVOL_CLOCK__
 #define __EVOL_CLOCK__
 #include <windows.h>
 
 #include <mmsystem.h>
 #include "evolDefs.h"
 #include "evolClockCallback.h"
 #include "evolArray.h"
 
 #define CLOCK_RESOLUTION 1    // 1ms intervals
 
 class evolClock
 {
 public:
 evolClock();
 virtual ~evolClock();
 UINT    registerEvolCallback(evolClockCallback* func);
 UINT    unRegisterEvolCallback(EVOL_CLOCK_HANDLE handle);
 UINT    startClock(EVOL_CLOCK_HANDLE handle);
 UINT    stopClock(EVOL_CLOCK_HANDLE handle);
 protected:
 UINT        clockCounter;
 evolArray<evolClockCallback*> clocks; }; #endif //__EVOL_CLOCK__
 
 However, when compiling I get the following error
 
 Program Files\dm\bin\sc.EXE -cpp -Ae -mn -C -o+time -D_WINDOWS -ff -Pz -S -3
-a8
 -c -gf -D_CONSOLE=1 -D_DEBUG=1 -D_X86_=1 -D_MT=1 -D_WIN32=1 -D_MBCS=1
 -oevolution.obj evolution.cpp Program Files\dm\bin\scpp.EXE -cpp -Ae -mn -C
 +time -D_WINDOWS -ff -Pz -S -3 -a8 -gf -D_CONSOLE=1 -D_DEBUG=1 -D_X86_=1
-D_MT=1
 -D_WIN32=1 -D_MBCS=1 evolution.cpp -oevolution.obj
 Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(358): parameter list
 is out of context
 Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(363): ')' expected
to
 close function parameter list with
 Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(406): ')' expected
 Error: C:\PROGRAM FILES\DM\BIN\..\include\win32\MMSYSTEM.H(441):
'sndPlaySoundW'
 is not in function parameter list Fatal Error: C:\PROGRAM
 FILES\DM\BIN\..\include\win32\MMSYSTEM.H(487): too many errors Lines Processed:
 81717  Errors: 5  Warnings: 0 Build failed
 
 Im wondering if someone would be good enough to assist me is solvong this
 problem ? I have run out of ideas myself and I now look to some more
 knowledgeable people to help me
 
 Thanks in advance
 
 Marc Teichtahl
 
 
 --
 No virus found in this outgoing message.
 Checked by AVG Anti-Virus.
 Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 4/14/2005
 
 
 thanks again
What is at line 358, 363, 406, 411 in your MMSYSTEM.H? Are you using the latest/greatest platform sdk from MS? If so where did place it? and did you change your include path to FIRST search this new SDK include dir? (see sc.ini) Arjan
Apr 18 2005