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
2
votes
1 answer
C++ exposed property names don't match the names given in the IDL
In the IDL file for a C++ component I have something like the following, allowing the property to be COM visisble:
interface IInterface
{
[propget, id(1), helpstring("the ID")]
HRESULT ID([out, retval] long *pVal);
}
When I build the…

MRAH
- 109
- 1
- 12
2
votes
0 answers
Windows RPC object marshalling
I'm trying to use Windows RPC for communcation between two processes (C/C++, 32bit, Win7).
I've followed the example here Instruction to RPC and successfully got RPC to work. Now I have difficulties getting the proxy / stub thing to work too.
The…

Stefan
- 4,187
- 1
- 32
- 38
2
votes
1 answer
Defining a pure base class using IDL
When I define an interface in IDL which does not derive from anything, the MIDL precompiler warns as such (Visual C++ 2008) :
warning MIDL2271 : [object] interfaces must derive from another [object] interface such as IUnknown (...)
And if I…

joelr
- 356
- 1
- 2
- 11
2
votes
1 answer
error MIDL2003: Redefinition : 'x'
I'm migrating an old C++ project to Visual Studio 2013. The project contains an .odl file. When I try to build the project I'm getting the following errors:
Error 3 error MIDL2025: syntax error : expecting ; near "{" C:\Program Files…

Madalin
- 129
- 15
2
votes
2 answers
Different output from midl.exe 6 and midl.exe 7
I'm tyring to convert a MSVC project from VS 2005 to VS 2008. It contains a IDL file that outputs a header and stubs used for RPC. The VS 2005 project uses MIDL.exe version 6.00.0366. The VS 2008 project uses MIDL.exe version 7.00.0500.
Here's the…

Charles
- 2,642
- 3
- 33
- 53
2
votes
1 answer
Serializing std::map c++
I have an object of std::map in my VC++ application. The format of the map is as follows:
map>> x;
I want to pass this object to server through a RPC call. So, I am using MIDL for creating the client and…

Prerak Sola
- 9,517
- 7
- 36
- 67
2
votes
2 answers
How does Visual Studio determine the order to compile IDL files?
I have a COM project that contains a number of IDL files, some of which are imported into other ones. How does Visual Studio decide which ones to compile (using MIDL) first?
I want to control the order. I have a master IDL file which contains my…

sourcenouveau
- 29,356
- 35
- 146
- 243
2
votes
0 answers
MIDL compiler appending a custom string-valued attribute
Is it possible to suppress the MIDL compiler from appending a custom atrribute to the resulting interface definition in the resulting COM dll build?
I'm suspecting that the attribute appended by MIDL compiler renders our dll to fail and cause an…

neolmartini
- 21
- 1
2
votes
1 answer
MIDL (Constant) References
Are there no constant references in MIDL method declarations????
eg.
[id(1), helpstring("My Method")]
HRESULT MyMethod(
[in] IID & const rclsid
);
for
HRESULT MyMethod(
IID const &rclsid
);
user358186
2
votes
1 answer
COM interface (MIDL): size_is for an optional [out] parameter
In short, in the following definition:
HRESULT GetStuff([in] long count,
[out, size_is(count)] long * a,
[out, size_is(count)] long * b);
which fills a and b with count elements, is it legal for the caller to set…

peterchen
- 40,917
- 20
- 104
- 186
2
votes
1 answer
Can an "enum" be used for flags in COM?
In the IDL for a COM object I do the following:
enum TxMyFlags
{
, flagOption = 1,
, flagOtherOption = 2,
, flagMoreOption = 4,
, flagAnotherFlag = 8,
, flagExtra = 128
// etc.
};
and have functions that can take the sum (or…

M.M
- 138,810
- 21
- 208
- 365
2
votes
1 answer
MIDL2015 warning when using importlib attribute
I have a legacy Visual Studio solution which contains several projects (has been upgraded to Visual Studio 2013). One of these projects generates a COM DLL. The TLB from this DLL is then imported into an IDL file of another project via the importlib…

steinybot
- 5,491
- 6
- 37
- 55
2
votes
1 answer
What are the RemoteRead and RemoteWrite members of ISequentialStream?
I am developing an COM library that uses the IStream interface to read and write data. My MIDL code looks like this:
interface IParser : IUnknown
{
HRESULT Load([in] IStream* stream, [out, retval] IParsable** pVal);
};
Since IStream and it's…

Carsten
- 11,287
- 7
- 39
- 62
2
votes
1 answer
Define a struct in a midl generated header file
I am in the process of automating the build of a legacy product and have hit a wall...
I have a .idl file that is compiled in VC++ 6.0 using midl to generate a .tlb, .h and .c file that has a manual build step to add:
struct StructDef;
Just ahead…

Rob Hunter
- 2,787
- 4
- 35
- 52
2
votes
2 answers
global scope enum and namespace conflict
I have an ATL COM service and in the .IDL file, I've declared an enum like so:
In Gourmet.idl
typedef enum Food
{
Chocolate = 0,
Doughnut,
HotDog
} Food;
A header file is automatically generated, creating Gourmet_i.h.
In another .CPP…

ykay
- 1,877
- 19
- 24