Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Fri, 16 Nov 2007 14:00:00 -0800,    group: microsoft.public.win32.programmer.directx.sdk        back       


directx 8.1b and visual C++ 2005 express   
I've been on directx 8.1b and vc++ 6.0 up until now and am seeing the light 
to move towards directx 9.0c (august 2007) and vc++ 2005 express.

But I am trying to move a 'directx 8.1b and vc++ 6.0' app to be 'directx 
8.1b and vc++ 2005 express'

I open the .dsw and get prompted to convert it to .vcproj, no problems.

I add the incl and lib 8.1b paths into my search paths.

When I complile I get many warning and errors out of the wizard code that 
the directx 8.1b env cretaed. One error I get is the following:

   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 ];

On the 'if( i != m_dwNumBuffers )' line I get the following complile error

.\dsutil.cpp(647) : error C2065: 'i' : undeclared identifier

This compiles fine under VC++ 6.0.

I anticipate this is because VC++ 2005 has stricter rules, perhaps, for 
inline declarations and DWORD i declare in the for loop above is out of 
scope?? *maybe*

There are lots of these compilation errors coming out of the code that was 
originally generated by the directx 8.1b wizard. Is there a way for me to get 
around this??

Thanks for any help.
date: Fri, 16 Nov 2007 14:00:00 -0800   author:   huh?

Re: directx 8.1b and visual C++ 2005 express   
On Fri, 16 Nov 2007 14:00:00 -0800, huh? wrote:

> .\dsutil.cpp(647) : error C2065: 'i' : undeclared identifier
> 
> This compiles fine under VC++ 6.0.
> 
> I anticipate this is because VC++ 2005 has stricter rules, perhaps, for 
> inline declarations and DWORD i declare in the for loop above is out of 
> scope?? *maybe*
> 
> There are lots of these compilation errors coming out of the code that was 
> originally generated by the directx 8.1b wizard. Is there a way for me to get 
> around this??

A common problem and you need to fix these so that the declaration is
outside the for loop so that it is standards conformant.  The compiler has
become more strict.

-- 
Please read this before replying:
1. Dshow & posting help:  http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others:  follow up if you are helped or you found a solution
date: Fri, 16 Nov 2007 16:37:42 -0700   author:   The March Hare [MVP] erland

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us