您的位置:首页 > 其它

使用Visual Studio.net 2005 编译 Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses 的问题

2008-06-10 11:06 651 查看
使用Visual Studio.net 2005 编译 Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses 的时候,

使用nmake ,

总是会出现一些编译过去的怪问题,

如:

环境:winxp SP2, Visual studio 8.0.5..., with .net framework 2.0.50727, Microsoft DirectX SDK (August 2007), and Microsoft Platform SDK (5.2.3790.1830.15.PlatformSDK_Svr2003SP1_rtm)

c:\Programme\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

in ctlutil.h

private:

// Prevent bugs from constructing from LONG (which gets

// converted to double and then multiplied by 10000000

COARefTime(LONG);

operator=(LONG);

};

c:\Programme\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

<- the line 278 referes to " operator=(LONG);"

================================================

on ctlutil.h, but I get another error C4430 in wxdebug.cpp

.\wxdebug.cpp(564) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

the line is: static g_dwLastRefresh = 0;

I have no ideia which type g_dwLastRefresh should be.

the code block is as follows:

BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level)

{

if(g_fAutoRefreshLevels)

{

// re-read the registry every second. We cannot use RegNotify() to

// notice registry changes because it's not available on win9x.

static g_dwLastRefresh = 0;

DWORD dwTime = timeGetTime();

if(dwTime - g_dwLastRefresh > 1000) {

g_dwLastRefresh = dwTime;

// there's a race condition: multiple threads could update the

// values. plus read and write not synchronized. no harm

// though.

DbgInitModuleSettings(false);

}

}

and on winutil.cpp

.\winutil.cpp(2104) : error C2065: 'Count' : undeclared identifier

code block:

"

// And likewise compare against the last ten entries

Result = GetSystemPaletteEntries(hdc,PalHiStart,PalLoCount,SystemEntries);

for (Count = 0;Count < Result;Count++) {

========================================

改正方法:

I had to change the code provided with platform SDK.

First the ctlutil.h from "operator=(LONG);" to "COARefTime& operator=(LONG);"

This solves one error and brings out 10 more.

Then wxdebug.cpp

from "static g_dwLastRefresh = 0;" to "static int g_dwLastRefresh = 0;"

Compile again and change in winutil.cpp

"for (Count = PalLoCount;INT(Count) < min(PalHiStart,iColours);Count++) {" to "for (int Count = PalLoCount;INT(Count) < min(PalHiStart,iColours);Count++) {"

in outputq.cpp add the line

long iDone = 0; just before the "

for (iDone = 0;

iDone < nSamples || (m_nBatched != 0 && m_bSendAnyway);"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: