Lisp HUG Maillist Archive

Is MIDL facility broken?

Hello all,

I tried MIDL on ShObjIdl.idl file recently and it does not go well at all
Which is very frustrating.
Please see partial output below.
Do we have workaround for this? I want to implement interface which is listed in ShObjIdl.idl

Midl.exe report following:

Microsoft (R) 32b/64b MIDL Compiler Version 8.00.0595
Copyright (c) Microsoft Corporation. All rights reserved.


PS
I specifically interested in IContextMenu, IShellExtInit (which it parses at least) and couple other interfaces but I could not get them all neither with MIDL nor with DEFSYSTEMs :MIDL-TYPE-LIBRARY-FILE options


CL-USER> (com:midl "C:\\Program Files (x86)\\Windows Kits\\8.0\\include\\um\\ShObjIdl.idl" :output-file t)
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\um\ShObjIdl.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\um\objidl.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\um\unknwn.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\shared\wtypes.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\shared\wtypesbase.idl

Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:114]: Unexpected symbol "annotation"
Skipping rest of statement.
Discarding symbols: ";" "ULONG" "AddRef" "(" ")" ";" "ULONG" "Release" "(" ")" ";" "}" "cpp_quote" "(" "#endif" ")" "cpp_quote" "(" "#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */" ")" "cpp_quote" "(" "#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" ")"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:137]: Unexpected symbol "annotation"
Skipping rest of statement.
Discarding symbols: ";" "HRESULT" "Begin_AddRef" "(" ")" ";" "ULONG" "Finish_AddRef" "(" ")" ";" "HRESULT" "Begin_Release" "(" ")" ";" "ULONG" "Finish_Release" "(" ")" ";" "}" "cpp_quote" "(" "#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */" ")" "cpp_quote" "(" "#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)" ")"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:165]: Unexpected symbol "annotation"
Skipping rest of statement.
Discarding symbols: ";"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:170]: Unexpected symbol "HRESULT"
Skipping rest of statement.
Discarding symbols: ";"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:175]: Unexpected symbol "HRESULT"
Skipping rest of statement.
Discarding symbols: ";"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:179]: Unexpected symbol "HRESULT"
Skipping rest of statement.
Discarding symbols: ";" "}"
Error: [c:\program files (x86)\windows kits\8.0\include\um\objidlbase.idl:115]: Unexpected symbol "annotation"
Skipping rest of statement.
Discarding symbols: ";" "HRESULT" "GetMarshalSizeMax" "("
Error: [c:\program files (x86)\windows kits\8.0\include\um\objidlbase.idl:125]: Unexpected symbol "annotation"

Sent from Windows Mail

Re: Is MIDL facility broken?

For records I was able to get on with this snippet

(lets see how far it will take me)

At least dummy D-C-I works

> (com:define-com-implementation my-ext ()
                                           ()
                                           (:interfaces i-shell-ext-init i-context-menu))

import "unknwn.idl";
import "wtypes.idl";
import "objidl.idl";
import "shtypes.idl";
[
    uuid(000214E8-0000-0000-C000-000000000046),
    object,
    local,
    pointer_default(unique)
]
interface IShellExtInit : IUnknown
{
    HRESULT Initialize(
        [in] PCIDLIST_ABSOLUTE pidlFolder,
        [in] IDataObject *pdtobj,
        [in] HKEY hkeyProgID);
}

//NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor
typedef struct _CMINVOKECOMMANDINFO
{
    DWORD cbSize;        // sizeof(CMINVOKECOMMANDINFO)
    DWORD fMask;         // any combination of CMIC_MASK_*
    HWND hwnd;           // might be NULL (indicating no owner window)
    LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
    LPCSTR lpParameters; // might be NULL (indicating no parameter)
    LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
    int nShow;           // one of SW_ values for ShowWindow() API
    DWORD dwHotKey;
    HANDLE hIcon;
} CMINVOKECOMMANDINFO;

// IContextMenu
[
    local,
    uuid(000214e4-0000-0000-c000-000000000046), // IID_IContextMenu
    pointer_default(unique),
]
interface IContextMenu : IUnknown
{
    HRESULT QueryContextMenu(
        [in] HMENU hmenu,
        [in] UINT indexMenu,
        [in] UINT idCmdFirst,
        [in] UINT idCmdLast,
        [in] UINT uFlags);

    HRESULT InvokeCommand([in] CMINVOKECOMMANDINFO *pici);

    HRESULT GetCommandString(
        [in] UINT_PTR idCmd,
        [in] UINT uType,
        [in] UINT * pReserved,
        [out] LPSTR pszName,
        [in] UINT cchMax);
}

typedef IContextMenu *LPCONTEXTMENU;



On Wed, Oct 23, 2013 at 7:17 PM, <yakov@clickgrab.net> wrote:
Hello all,

I tried MIDL on ShObjIdl.idl file recently and it does not go well at all
Which is very frustrating.
Please see partial output below.
Do we have workaround for this? I want to implement interface which is listed in ShObjIdl.idl

Midl.exe report following:

Microsoft (R) 32b/64b MIDL Compiler Version 8.00.0595
Copyright (c) Microsoft Corporation. All rights reserved.


PS
I specifically interested in IContextMenu, IShellExtInit (which it parses at least) and couple other interfaces but I could not get them all neither with MIDL nor with DEFSYSTEMs :MIDL-TYPE-LIBRARY-FILE options


CL-USER> (com:midl "C:\\Program Files (x86)\\Windows Kits\\8.0\\include\\um\\ShObjIdl.idl" :output-file t)
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\um\ShObjIdl.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\um\objidl.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\um\unknwn.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\shared\wtypes.idl
;;; Processing C:\Program Files (x86)\Windows Kits\8.0\include\shared\wtypesbase.idl

Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:114]: Unexpected symbol "annotation"
Skipping rest of statement.
Discarding symbols: ";" "ULONG" "AddRef" "(" ")" ";" "ULONG" "Release" "(" ")" ";" "}" "cpp_quote" "(" "#endif" ")" "cpp_quote" "(" "#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */" ")" "cpp_quote" "(" "#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" ")"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:137]: Unexpected symbol "annotation"
Skipping rest of statement..
Discarding symbols: ";" "HRESULT" "Begin_AddRef" "(" ")" ";" "ULONG" "Finish_AddRef" "(" ")" ";" "HRESULT" "Begin_Release" "(" ")" ";" "ULONG" "Finish_Release" "(" ")" ";" "}" "cpp_quote" "(" "#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */" ")" "cpp_quote" "(" "#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)" ")"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:165]: Unexpected symbol "annotation"
Skipping rest of statement..
Discarding symbols: ";"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:170]: Unexpected symbol "HRESULT"
Skipping rest of statement.
Discarding symbols: ";"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:175]: Unexpected symbol "HRESULT"
Skipping rest of statement.
Discarding symbols: ";"
Error: [c:\program files (x86)\windows kits\8.0\include\um\unknwnbase.idl:179]: Unexpected symbol "HRESULT"
Skipping rest of statement.
Discarding symbols: ";" "}"
Error: [c:\program files (x86)\windows kits\8.0\include\um\objidlbase.idl:115]: Unexpected symbol "annotation"
Skipping rest of statement.
Discarding symbols: ";" "HRESULT" "GetMarshalSizeMax" "("
Error: [c:\program files (x86)\windows kits\8.0\include\um\objidlbase.idl:125]: Unexpected symbol "annotation"

Sent from Windows Mail




--
Yakov Zaytsev
+7 921 343 4327 (Russia)
Updated at: 2020-12-10 08:34 UTC