Hi, I'm SUN MI -- I used visual studio 2010
my error suddenly happen in this part (-- _- -) Plz help me
when you have idea, email me in *REMOVED MAIL*
if (!InitializeCriticalSection && SpinCount(&m_sec, 0))
{
hRes = HRESULT_FROM_WIN32(GetLastError());
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error 2 error C3861: 'SpinCount': cannot find. d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h 115 1 Commu
3 IntelliSense: 식별자 "SpinCount"이(가) no definition. d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h 115 37
warning 1 warning C4551: cannot call. d:\program files\microsoft visual studio 10.0\vc\atlmfc\include\atlcore.h 115 1 Commu
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This file is atlcore.h
#ifndef __ATLCORE_H__
#define __ATLCORE_H__
#pragma once
#ifdef _ATL_ALL_WARNINGS
#pragma warning( push )
#endif
#pragma warning(disable: 4786) // identifier was truncated in the debug information
#pragma warning(disable: 4127) // constant expression
#include <atldef.h>
#include <windows.h>
#include <ole2.h>
#include <limits.h>
#include <tchar.h>
#include <mbstring.h>
#include <atlchecked.h>
#include <atlsimpcoll.h>
#include <WinNT.h>
#if _WIN32_WINNT < 0x0403
#endif
#pragma pack(push,_ATL_PACKING)
namespace ATL
{
inline BOOL AtlIsValidString(
_In_z_count_(nMaxLength) LPCWSTR psz,
_In_ size_t nMaxLength = INT_MAX)
{
(nMaxLength);
return (psz != NULL);
}
inline BOOL AtlIsValidString(
_In_z_count_(nMaxLength) LPCSTR psz,
_In_ size_t nMaxLength = UINT_MAX)
{
(nMaxLength);
return (psz != NULL);
}
inline BOOL AtlIsValidAddress(
_In_opt_bytecount_(nBytes) const void* p,
_In_ size_t nBytes,
_In_ BOOL bReadWrite = TRUE)
{
(bReadWrite);
(nBytes);
return (p != NULL);
}
template<typename T>
inline void AtlAssertValidObject(
_In_opt_ _Prepost_opt_bytecount_x_(sizeof(T)) const T *pOb)
{
ATLASSERT(pOb);
ATLASSERT(AtlIsValidAddress(pOb, sizeof(T)));
if(pOb)
pOb->AssertValid();
}
#ifdef _DEBUG
#define ATLASSERT_VALID(x) ATL::AtlAssertValidObject(x)
#else
#define ATLASSERT_VALID(x) __noop;
#endif
class CComCriticalSection
{
public:
CComCriticalSection() throw()
{
memset(&m_sec, 0, sizeof(CRITICAL_SECTION));
}
~CComCriticalSection()
{
}
HRESULT Lock() throw()
{
EnterCriticalSection(&m_sec);
return S_OK;
}
HRESULT Unlock() throw()
{
LeaveCriticalSection(&m_sec);
return S_OK;
}
HRESULT Init() throw()
{
HRESULT hRes = S_OK;
void InitializeCriticalSectionSpinCount(LPCRITICAL_SECTION CRITICAL_SECTION,DWORD SpinCount);
if (!InitializeCriticalSection && SpinCount(&m_sec, 0))
{
hRes = HRESULT_FROM_WIN32(GetLastError());
}
return hRes;
}
HRESULT Term() throw()
{
DeleteCriticalSection(&m_sec);
return S_OK;
}
CRITICAL_SECTION m_sec;
};
class CComAutoCriticalSection :
public CComCriticalSection
{
public:
CComAutoCriticalSection()
{
HRESULT hr = CComCriticalSection::Init();
if (FAILED(hr))
AtlThrow(hr);
}
~CComAutoCriticalSection() throw()
{
CComCriticalSection::Term();
}
private :
HRESULT Init();
HRESULT Term();
};
class CComSafeDeleteCriticalSection :
public CComCriticalSection
{
public:
CComSafeDeleteCriticalSection(): m_bInitialized(false)
{
}
~CComSafeDeleteCriticalSection() throw()
{
if (!m_bInitialized)
{
return;
}
m_bInitialized = false;
CComCriticalSection::Term();
}
HRESULT Init() throw()
{
ATLASSERT( !m_bInitialized );
HRESULT hr = CComCriticalSection::Init();
if (SUCCEEDED(hr))
{
m_bInitialized = true;
}
return hr;
}
HRESULT Term() throw()
{
if (!m_bInitialized)
{
return S_OK;
}
m_bInitialized = false;
return CComCriticalSection::Term();
}
HRESULT Lock()
{