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
CLANG compiled MIDL RPC generated code incorrect function argument serialization
Trying to run CLANG compiled, MIDL generated RPC client code, however it explodes on server side because the way MIDL generated client code serializes the function arguments in revers order.
MIDL is invoked as
midl MyRPCInterface.idl /env win32…

Niki
- 558
- 4
- 10
1
vote
1 answer
pass ref class object(Uri^) as native pointer parameter(IUriRuntimeClass *)
I have following midl method in my code:
interface IMyClass : IInspectable
{
HRESULT Func1([in] Windows.Foundation.Uri *uri);
}
It generates following interface method:
IMyClass : public IInspectable
{
public:virtual HRESULT…

miradham
- 2,285
- 16
- 26
1
vote
0 answers
Pass C# array of user defined struct to COM via MIDL
I have a custom struct defined in MIDL:
struct Foo
{
[string] char* Bar;
int Baz;
}
I'm trying to pass this from a C# application to a C++ application. The interface assembly was generated with tlbimp.exe.
I should mention that I have next…

Stjepan Bakrac
- 1,047
- 11
- 18
1
vote
1 answer
Portable address offset parameter in IDL
I'm porting an old 32-bit COM server to 64-bit architecture.
Many functions take buffer addresses and offsets as parameters, as __int3264 and __int3264 pointers. The problem is that this type is not automatically generated as __int64 in x64 since…

Hernán
- 4,527
- 2
- 32
- 47
1
vote
0 answers
Tlbimport (tlb generated from a C# library)
We have created a simple C# class library like this (ClassLibrary1):
[ComVisible(true)]
public struct MyTestStruct
{
public int z;
public int h;
}
[ComVisible(true)]
public interface IMyTestInterface
{
void…

Viktor Kamarás
- 11
- 2
1
vote
1 answer
Compiler Error C3646 'unknown override specifier' in auto generated .tlh when using importlib in idl
I use Visual Studio 2015 and I have a C# Application-Project that defines a COM-Interface and generates a .tlb file on compilation. Now I want to import that Csharp.tlb into an idl.
MyLibrary.idl:
import "oaidl.idl";
import "ocidl.idl";
import…

MaLe
- 33
- 6
1
vote
0 answers
Define optional char / wchar_t pointer parameter in MIDL
I have an existing Win32 C++ DLL, which needs to be accessed by a VB6 client. One of the exported functions is defined as follows:
__declspec(dllexport) long __stdcall Foo(long nId, LPCWSTR pszwPath = nullptr);
Unfortunately, VB6 always converts…

Aurora
- 1,334
- 8
- 21
1
vote
3 answers
Merging two .IDL files or two .tlb files into one file
I have 2 .net dll's which I expose to COM using REGASM. In order to simplify referencing within a COM client I would like to make these into one file.
I have tried converting both files to IDL and then copying the contents of the Library section of…

Jambobond
- 619
- 3
- 12
- 23
1
vote
0 answers
Omitting compilation time from MIDL generated files
Microsoft's MIDL compiler always adds a date/time information to generated *.h and *.c files:
/* File created by MIDL compiler version 8.00.0603 */
/* at Sun Nov 01 17:37:44 2015
*/
I want to keep these files in Version Control System, even though…

Michael Grafnetter
- 107
- 4
1
vote
1 answer
Prevent recompilation of oaidl.idl and ocidl.idl
I have a COM/ATL project with a number of IDL files. Most of these IDL files import oaidl.idl and ocidl.idl.
Whenever I compile my project, Visual Studio calls MIDL to recompile oaidl.idl and ocidl.idl... every single time it encounters the imports.…

sourcenouveau
- 29,356
- 35
- 146
- 243
1
vote
2 answers
MIDL compilation error (and maybe idl file generation question)
We're looking into moving our application from VS2008 to VS2010.
We generate some COM objects with "attributed programming" and the IDL is automatically generated.
The import directives for both files are different and the compilation fails on…

Max
- 3,128
- 1
- 24
- 24
1
vote
1 answer
MIDL Complex Types As Interface Method Parameters
I would like to know if maybe there are some good solutions to handling complex types not importable into IDL. My biggest concern is using _m128 vector types for simmed instructions ie. XMVECTOR. __declspec is not recognized by the midl compiler…
user358186
1
vote
1 answer
Avoid gcc warning for (generated) tokens after preprocessing directive?
Microsoft's MIDL compiler generates C/C++ source code files that are slightly invalid, like the code in this extract:
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
#define…

Cheers and hth. - Alf
- 142,714
- 15
- 209
- 331
1
vote
1 answer
ATL and types from scrrun.dll
I have interface in ATL project which must contains member with parameter of Scripting::IDictionary** but in MIDL file with description of my interface it's not possible because Scripting library is not presented in default library. I always have…

shadeglare
- 7,006
- 7
- 47
- 59
1
vote
1 answer
Two simple COM IDL syntax questions: is there a way to specify the threading model, and do I need void to say "no arguments"?
Two simple COM IDL file questions I can't seem to find answers for, even with searching MSDN and the general internet:
Is there an interface attribute which lets me specify my interface is to be implemented by STA objects only, or is this a detail…

andlabs
- 11,290
- 1
- 31
- 52