including dshow.h compiles not with /clr but with /clr:oldSyntax

Hello,

can somebody tell why I get 103 errors
with /clr and none with /clr:oldSyntax
when I include the dshow header file.
I would like to use the new syntax.

Win32 console app generated by VC Express
with line added to include dshow.h

#include "stdafx.h"
#include <dshow.h>

int _tmain(int argc, _TCHAR* argv[])
{
    return 0;
}

Regards,
stax


Answer this question

including dshow.h compiles not with /clr but with /clr:oldSyntax

  • Wowbagger_TIP

    I installed the latest DirectX SDK (April 2005). It does not include dshow.h. Without knowing what errors you are seeing, it's impossible to diagnose why your code example fails to compile.

  • Ken Holcombe

    it appears that dshow was seperated from dx, I needed the dshow documentation so I downloaded only the dshow part of the latest platform sdk as I couln't find it somewhere else and I didn't want to wait until the entire sdk downloads. I started trying downloading the entire sdk but that seemed to take ages. Because of this I used the inlude and lib directories of the sdk installed with VS 2003. I hope this wasn't too awkward.

    this is the code causing the first errors:

    /* here is where we pull in the MIDL generated headers for the interfaces */
    typedef interface    IRpcStubBuffer     IRpcStubBuffer;

    and this are the 20 first errors:

    Error    4    error C2146: syntax error : missing ';' before identifier 'IRpcStubBuffer'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\objbase.h    398
    Error    5    error C4430: missing type specifier - int assumed. Note: C++ does not support default-int    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\objbase.h    398
    Error    6    error C2079: 'IRpcStubBuffer' uses undefined struct 'IRpcStubBuffer'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\objbase.h    398
    Error    7    error C2146: syntax error : missing ';' before identifier 'IRpcChannelBuffer'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\objbase.h    399
    Error    8    error C2371: 'IRpcChannelBuffer' : redefinition; different basic types    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\objbase.h    399
    Error    9    error C2146: syntax error : missing ';' before identifier 'IUnknown'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    48
    Error    11    error C2146: syntax error : missing ';' before identifier 'AsyncIUnknown'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    54
    Error    13    error C2146: syntax error : missing ';' before identifier 'IClassFactory'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    60
    Error    15    error C2371: 'IUnknown' : redefinition; different basic types    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    110
    Error    16    error C2065: 'This' : undeclared identifier    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    136
    Error    17    error C2065: '_pRpcChannelBuffer' : undeclared identifier    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    137
    Error    18    error C2275: 'IRpcChannelBuffer' : illegal use of this type as an expression    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    137
    Error    19    error C2275: 'PRPC_MESSAGE' : illegal use of this type as an expression    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    138
    Error    20    error C2146: syntax error : missing ')' before identifier '_pRpcMessage'    C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\unknwn.h    138


  • DOMcCrea

    Which version of the DirectX SDK are you using It's possible that you're still on an older version of the managed SDK, which was written in the old managed C++ syntax. If you're still getting the problem with a recent version of the SDK then please let us know and as Brandon mentioned, more specific errors are always welcome.

    Thanks,


  • Echo

    You have nailed down the problem: the new C++/CLI syntax is (as its name indicates) just now being released with Visual Studio 2005. Thus, the code inside the SDK from VS 2003 is written using the old syntax and cannot be compiled without the /clr:oldsyntax switch. We are doing our best to make the transition from old to new syntax a smooth one, and individual files in your project can be compiled with different syntax. However, there is simply no way for the compiler to differentiate between the code coming through the included headers for the file in question and the only solution is to get the new SDK.

    I hope the download time is not too much of an inconvenience and I'm sure you'll find the benefits of the new syntax outweigh it.



  • including dshow.h compiles not with /clr but with /clr:oldSyntax