web123456

VS2010 Syntax Error: The most complete solution to the identifier "__RPC__out_xcount_part"

Problem description: The project was written in vs2008 before, and later when recompiling it on vs2010, I found the following error:

1>------ Started Generation: Project: Test, Configuration: Debug Win32 ------
1>
1>c:/program files/microsoft sdks/windows/v7.0a/include/(11280): error C2061: Syntax error:Identifier“__RPC__out_xcount_part”
1>c:/program files/microsoft sdks/windows/v7.0a/include/(11281): error C2059: Syntax error: ")"
1>c:/program files/microsoft sdks/windows/v7.0a/include/(11281): fatal error C1903: Cannot recover from previous error; compilation is being stopped
========== Generate: 0 successful, 1 failed, the latest 0, 0 skipped ============

Solution process:

I have searched for many solutions online, roughly the following:

Method 1:

Put the Windows SDK inclusion directory first!

Operation: Right-click on the project -> Properties -> Configure properties -> VC + + directory, modify the "Include directory", and put $(WindowsSdkDir) include first. Recompile. The problem was solved.

Method 2:

Solution:

Add the following precompiled instructions in the DX directory:

#define __RPC__out_xcount_part(size, length)
#define __RPC__in_xcount(size)
#define __RPC__in_xcount_full(size)
#define __RPC__in_range(min, max)
#define __RPC__inout_xcount(size)

Most of the solutions are the above two, but I have tried them all and they all ended in failure. Later, in a post, a netizen saw another solution in a reply:

Method 3:

Delete the DX directory. The problem has been resolved.