Please see this minimal example of my interface definition.
The .idl file:
#pragma once
import "oaidl.idl";
#define RC_INVOKED 1
#include <CertSrv.h>
[
object,
uuid(A9A5951C-B9C3-45DA-94AA-7959959AA5C3),
helpstring("My minimal example Interface"),
local
]
interface IMinimalExample : IUnknown
{
HRESULT Initialize();
};
This does not compile as long as CertSrv.h
is included. As soon as I remove the include, it compiles just fine.
I am using midl.exe from the Windows 10 SDK (10.0.18362). The project is set to use the latest found Windows 10 SDK and platform toolset v142. I also confirmed that in fact the latest version of midl.exe is used.
The compiler errors:
MIDL2025 syntax error : expecting a declarator or * near "handle_t" C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\rpcdce.h 74
MIDL2025 syntax error : expecting ; or , near "handle_t" C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\rpcdce.h 74
MIDL2025 syntax error : expecting a type specification near "LPOVERLAPPED" C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\rpcasync.h 121
I added #define RC_INVOKED 1
to get rid of other related errors (related to INT, _LARGE_INTEGER, and others in winnt.h).
Has anyone encountered this before and can point me in the right direction?