I am attempting to create a C# inproc server for sbtsv.idl
(it is included with the Windows 8 SDK). Almost every instructions I find tell you to use MIDL
to create a .tlb
file then tlbimport
to create the proxy dll.
However, if the IDL does not include a library
section no .tlb
file will be generated, and sbtsv.idl
does not include a library
section.
I tried creating my own IDL file that declared the interface I wanted to create inside a library
#include "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include\sbtsv.idl"
[uuid(43250D0C-BBC6-4109-BCD2-6F61F0D3B611)]
library sbtsvClientLib
{
interface ITsSbResourceNotification;
};
However when I try to run it through MIDL
i get the following error
Microsoft (R) 32b/64b MIDL Compiler Version 8.00.0603 Copyright (c) Microsoft Corporation. All rights reserved. Processing .\sbtsvClientLib.idl sbtsvClientLib.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\um\oaidl.idl oaidl.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\um\objidl.idl objidl.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\um\unknwn.idl unknwn.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\shared\wtypes.idl wtypes.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\shared\wtypesbase.idl wtypesbase.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\shared\basetsd.h basetsd.h Processing C:\Program Files (x86)\Windows Kits\8.1\include\shared\guiddef.h guiddef.h Processing C:\Program Files (x86)\Windows Kits\8.1\include\um\SessdirPublicTypes.idl SessdirPublicTypes.idl Processing C:\Program Files (x86)\Windows Kits\8.1\include\um\oaidl.acf oaidl.acf midl\oleaut32.dll : error MIDL2020 : error generating type library : SetFuncAndParamNames failed : put_State (0x8002802C)
I am thinking I am going to be forced to write the classes and interfaces by hand, but I wanted to check to see if I was doing anything wrong that would allow this to work.