Expand|Select|Wrap|Line Numbers
- ------ Build started: Project: Play_Sound, Configuration: Debug Win32 ------
- Compiling...
- dsutil.cpp
- c:\documents and settings\###\my documents\visual studio 2008\projects\play_sound\play_sound\dsutil.cpp(686) : error C2065: 'i' : undeclared identifier
- c:\documents and settings\###\my documents\visual studio 2008\projects\play_sound\play_sound\dsutil.cpp(687) : error C2065: 'i' : undeclared identifier
- Build log was saved at "file://c:\Documents and Settings\###\My Documents\Visual Studio 2008\Projects\Play_Sound\Play_Sound\Debug\BuildLog.htm"
- Play_Sound - 2 error(s), 0 warning(s)
- ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And the exact lines that have this problem are
Expand|Select|Wrap|Line Numbers
- LPDIRECTSOUNDBUFFER CSound::GetFreeBuffer()
- {
- if( m_apDSBuffer == NULL )
- return FALSE;
- for( DWORD i=0; i<m_dwNumBuffers; i++ )
- {
- if( m_apDSBuffer[i] )
- {
- DWORD dwStatus = 0;
- m_apDSBuffer[i]->GetStatus( &dwStatus );
- if ( ( dwStatus & DSBSTATUS_PLAYING ) == 0 )
- break;
- }
- }
- if( i != m_dwNumBuffers )
- return m_apDSBuffer[ i ];
- else
- return m_apDSBuffer[ rand() % m_dwNumBuffers ];
- }
and it's too complicated for me to figure out, i was thinking it was something with the braces and the "i" not being a identified in the "if" statement, although the program worked when i changed their location, there was no sound :(
kind regards,
Netwatcher.