bool InitDS( HWND hwnd ); bool PlayDS( bool loopSound, int id ); bool StopDS( int id ); bool SetVolumeDS( int vol, int id ); bool SetFrequencyDS( int freq, int id ); bool SetPanDS( int pan, int id ); bool DeInitDS(); int Load_WAV( char* filename, int CONTROL_FLAGS = DSBCAPS_CTRLDEFAULT );
#endif // for sound.h
#endif // for dsound.h
#endif // for mmsystem.h
#endif // for windows.h
[edited by - zyroth on October 2, 2002 4:45:21 PM]
try it this way and see if it works. as you can see the "endif"s belong at the very bottom of the code, not right under the ifndef and define. this rule applies whether you have one or a million.
why.... *hmm* whyyy would you #ifndef/#endif around each #include? The header should (if I''m not mistaken) already to that for you! I think that is the whole point... *~*
You may also want to make any variables in the .h file extern
#ifndef SOUND_H // is this used elsewhere?! #define SOUND_H #include <windows.h> // inside: #ifndef, ETC.
ok... #ifndef SOUND_H is (I believe) ''global like''... so if you have another file using SOUND_H as it''s ''bounds'' then one of the two files will NOT be included.
I was saying, don''t put #ifndef''s around the #include''s in the .h, or .cpp... it should be done for you in the .h you are including.
quote: my guess is that your Sound.h isn''t just definitions but it is also code. you should be splitting everything into a .h AND a .cpp
No he shouldn''t. Keeping smaller methods in the .h file will inline them, which is advantageous. Larger methods should always be implemented in the .cpp file however.
"I don''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein