MIDL (Microsoft Interface Definition Language) is a text-based interface description language by Microsoft, based on the DCE/RPC IDL which it extends for use with the Microsoft Component Object Model. Its compiler is also called MIDL.
Questions tagged [midl]
186 questions
1
vote
1 answer
How to add and implement a new interface to an Inproc COM server
I've implemented a windows deskband (using the windows SDK sample) and need a way to communicate (one call to start IPC with another application, IPC is already working) with it.
My COM experience is very limited but extrapolating from what I've…

deepthought42
- 87
- 6
1
vote
1 answer
Problems with midl.exe and cppwinrt.exe from CMake
This is somewhat of a follow-on to How to use midlrt.exe to compile .idl to .winmd?
I have this in my CMakeLists.txt . My questions are less about the CMake logic and more about the output of the midl and cppwinrt commands, and subsequent errors in…

Theodore Hall
- 91
- 1
- 6
1
vote
0 answers
What is maximum length of MIDL helpstring attrubute?
Looks like MIDL helpstring attribute has a limitation on string length although not documented.
As I see, it's around 260 characters (similar to MAX_PATH constant).
Does anybody know something about it?

23W
- 1,413
- 18
- 37
1
vote
1 answer
Why doesn't `cpp_quote` and `pragma midl_echo` used in a .idl file output anything to the generated header in a C++/WinRT project?
I'm trying to add some C++ code to the generated header coming form the MIDL compiler, using the cpp_quote attribute.
But nothing gets added to the generated output, and I have no idea why.
I use VS 2019 with the C++/WinRT extension, the project is…

Balázs Kovacsics
- 693
- 5
- 17
1
vote
0 answers
What causes MIDL2025 error when including CertSrv.h?
Please see this minimal example of my interface definition.
The .idl file:
#pragma once
import "oaidl.idl";
#define RC_INVOKED 1
#include
[
object,
uuid(A9A5951C-B9C3-45DA-94AA-7959959AA5C3),
helpstring("My minimal…

Exa
- 4,020
- 7
- 43
- 60
1
vote
0 answers
How can I project a templated C++ API to WinRT via c++/winrt?
I have a pre-existing native C++ library I am trying to expose to UWP applications by projecting the API through a C++/WinRT Runtime Component. I am having difficulty understanding how to expose templated functions.
For the following example C++…

Sean Kelly
- 338
- 1
- 10
1
vote
1 answer
How to get an enumeration value when using IMetadataImport
Short version
How to you get the numeric value associated with an enum from a *.winmd file when using IMetadataImport?
A good example is ApplicationHighContrastAdjustment enumeration:
//Windows.UI.Xaml.ApplicationContrastMode (@020000006)
public…

Ian Boyd
- 246,734
- 253
- 869
- 1,219
1
vote
1 answer
Getting MIDL 2003 Redefinition errors
I have a very simple program that I am trying to compile before I build it out any further. I am trying to learn COM so following along here, I create app.h and app.cpp file in VS 2017 and using the ATL Template. When I try to build the solution I…

Cod.ie
- 380
- 5
- 14
1
vote
1 answer
WIndows 10 MIDL.exe
I need to convert some IDL files to C# class/Interfaces.
I am not able to get the MIDL.exe compiler.
I am running windows 10, and I have few Visual studio versions installed on my machine, I also download and install the Microsoft SDK but I am not…

pix
- 1,264
- 19
- 32
1
vote
1 answer
How to declare nested templates in idl 3.0
I have what I hope is a basic question, but I've been unsuccessful finding any documentation or examples on MSDN or the internet in general.
I'm implementing a windows runtime component in C++/WinRT. I have an asynchronous method that scans for the…

Sean Kelly
- 338
- 1
- 10
1
vote
1 answer
How to declare an enum in an .IDL file?
I have a runtimeclass that I would like to add an enum to. I have tried the following syntax as suggested by the MSDN documentation here: https://learn.microsoft.com/en-ca/uwp/midl-3/intro
namespace my_project
{
runtimeclass my_rt_class
{ …

mbl
- 805
- 11
- 18
1
vote
1 answer
MIDL Compiler error: MIDL
When I use MIDL to compile a IDL file to .h and .c, I get a error said:
midl : command line error MIDL1004 : cannot execute C preprocessor cl.exe.
Please kindly help me, I do not know why.
The MIDL compiler which I use is part of VC++ 6.0.
Thanks.

Ji Guorui
- 15
- 1
- 3
1
vote
0 answers
MIDL: Proper syntax for outputting namespaces for user defined types / enums?
I took my .NET assembly, used OleView to generate the IDL file, now using
midl /header MyAssembly.h MyAssembly.tlb
to generate a header file for use in a really old COM project.
Now, MyAssembly.dll references MyAssembly.Core.dll - so I created an…

John
- 921
- 1
- 9
- 24
1
vote
1 answer
Retrieve array through WRL idl
I have asked same question here as well.
I am having trouble with making API that would return Array of objects.
Here is what I have tried so far.
I wrote method that would return array as parameter
HRESULT GetMyObjectList([out] UINT32* objCount,…

miradham
- 2,285
- 16
- 26
1
vote
1 answer
regsvr32 not registering COM dispinterface
My system is a Windows 10 64-bit fall creators edition with Visual Studio 2017 Professional.
I have a COM interface with the following IDL (ISomeInterface.idl):
import "oaidl.idl";
import "ocidl.idl";
[
object,
…

ScoJay
- 19
- 7