none
can't compile WinRT idl file

    Întrebare

  • Hi everyone,

    I'm trying to compile WinRT idl files but always got failed , for example , do a syntax check :

    midl windows.devices.portable.idl /Zs

    told me the following errors :

    C:\Program Files\Windows Kits\8.0\include\winrt\IVectorChangedEventArgs.idl(11)
    : error MIDL2025 : syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or ContractName or a type specification  near "namespace"
    C:\Program Files\Windows Kits\8.0\include\winrt\IVectorChangedEventArgs.idl(11)
    : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

    what's wrong with this ? many thanks.


    nice done!

    2 mai 2012 12:27

Toate mesajele

  • Similar error:

    C:\Program Files (x86)\Windows Kits\8.0\Include\winrt\IVectorChangedEventArgs.idl(11): error MIDL2025: syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or ContractName or a type specification near "namespace"

    //  Copyright (c) Microsoft Corporation. All rights reserved.
    //
    //  WindowsRuntimeAPISet
    
    import "oaidl.idl";
    import "inspectable.idl";
    import "asyncinfo.idl";
    import "eventtoken.idl";
    #include <sdkddkver.h>
    
    namespace Windows.Foundation.Collections
    {
        [version(NTDDI_WIN8)]
        typedef enum CollectionChange 
        {
            Reset,          // Much of the Vector has changed.
            ItemInserted,   // An item added to the Vector.
                            // NewIndex contains the index of the item that was added.
            ItemRemoved,    // An item deleted from the Vector.
                            // NewIndex contains the index of the item that was deleted
            ItemChanged,    // An item changed in the Vector.
                            // NewIndex contains the index of the item that was changed.
        } CollectionChange;
    
        [
            object,
            uuid(575933df-34fe-4480-af15-07691f3d5d9b),
            pointer_default(unique),
            version(NTDDI_WIN8)
        ]
        interface IVectorChangedEventArgs : IInspectable
        {
            [propget] HRESULT CollectionChange ([out, retval] CollectionChange * value);
            [propget] HRESULT Index ([out, retval] unsigned* value);
        };
    
    
    }


    • Editat de X-MAN 23 ianuarie 2013 21:37
    23 ianuarie 2013 21:34
  • any solution to the above problem ?
    23 mai 2013 22:11
  • Try passing /winrt on the MIDL command line.
    31 octombrie 2013 20:03