Questions tagged [midl]

1

votes
1

answer
204

Views

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, uuid(61E246F6-3F22-404B-8EA8-E4D13F3206D6), pointer_default(unique) ] interface ISomeInte...
ScoJay
1

votes
0

answer
71

Views

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 IDL file for MyAssembly.Core.dll as well as mscorlib...
John
1

votes
1

answer
164

Views

What is a composable runtime class?

I'm experimenting with creating a simple xaml appilcation using C++/WinRT. I come from a WPF background where it is pretty common to have a base class that implements INotifyPropertyChanged and have other classes inherit from it. When I try to do the same with C++-WinRT I fail with an error error M...
Nina Kaprez
1

votes
1

answer
90

Views

How to use the TemplatePart attribute on a custom control?

I started developing a UWP XAML custom control using the new C++/WinRT language projection. I got the basic structure right, but I'm stuck when it comes to defining the TemplatePartAttribute attribute. In C#, and even C++/CX, this is pretty much straightforward because the language has direct suppor...
Florian S.
1

votes
1

answer
293

Views

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 able to find the MIDL.exe binary any where. C:\Progr...
pix
1

votes
1

answer
71

Views

How to get the Interface ID (IID, i.e. the GUID) of an interface when importing a WinRT winmd?

Short version How to you get the interface identifier (IID) for an interface from a *.winmd file when using IMetadataImport? e.g. Windows.Globalization.ICalendar: {CA30221D-86D9-40FB-A26B-D44EB7CF08EA} Longer Version A good example is Windows.Globalization.ICalendar interface. It's IID is CA30221D-8...
Ian Boyd
1

votes
2

answer
1.3k

Views

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 problem: MIDL v6 outputs the following prototype f...
Charles
1

votes
2

answer
1.1k

Views

How do I declare an IStream in idl so visual studio maps it to s.w.interop.comtypes?

I have a COM object that takes needs to take a stream from a C# client and processes it. It would appear that I should use IStream. So I write my idl like below. Then I use MIDL to compile to a tlb, and compile up my solution, register it, and then add a reference to my library to a C# project. Visu...
Grahame Grieve
1

votes
1

answer
375

Views

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 scrrun.tlb and trying to use it in MIDL but it's not...
shadeglare
1

votes
1

answer
183

Views

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 so importing the __m128 data type is out of the ques...
Rebeka Fox
1

votes
1

answer
593

Views

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. These two IDL files end up getting recompiled mult...
M. Dudley
1

votes
3

answer
777

Views

Weird IDL error after migration to VS2010

Here's a very simple IDL interface that we've used successfully under VS2008 (arguments list shortened for brevity): interface Mailer { string findNode( [in] string requestedNode ); unsigned short addMessage( [in] string msg, [in] unsigned short kind ); }; We're migrating the solution to VS2010 SP1....
Serge Wautier
1

votes
1

answer
918

Views

Separate MIDL project in Visual Studio

I'm trying to make separate project for generated files from midl compiler. I have .idl file with rpc definitions. Midl compiler generates two files. For server and for client. And I need to add symbols from generated files to other projects. My question is how to setup properly project for midl co...
userbb
1

votes
1

answer
114

Views

MIDL tab in VS6

I'm assigned to build a visual studio 6 C++ project (I'm aware this is a problem in itself...). I added an IDL file to the project, but the MIDL tab is not showing for the project or for the file itself. How to make the MIDL tab appear? Thank you.
grunt
1

votes
1

answer
113

Views

Who called my RPC?

I'm building an Microsoft RPC server and I was wondering if there is a way to determine which user called the RPC function? (meaning, which user is running the process that invoked the RPC method)
DiGMi
1

votes
1

answer
867

Views

Problem compiling IDL created with OleView

To correct a problem with the name of the value for the enum, after searching, that I need to modify the TLB file of my DLL. The first step that I need to do is to create the IDL file. So I use Oleview to create the file. Before doing the modification I to correct my problem, I decided to try and co...
Stephan
1

votes
1

answer
262

Views

Is inheritance allowed on a COM interface which has the nonextensible attribute?

I have an interface which inherits from another interface, like this: [ object, uuid(72A6E473-9956-4856-A335-B9169359AACE), dual, nonextensible, pointer_default(unique) ] interface IA : IDispatch { HRESULT MethodA(); } [ object, uuid(378846D3-7E24-4DAE-B4DF-69AA4B0C1AA9), dual, nonextensible, pointe...
Johan
1

votes
1

answer
101

Views

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 for my documentation alone? I already have [object,...
andlabs
1

votes
1

answer
125

Views

Are aggregated objects forced to be an IUnknown reference?

I am trying to implement shared logic using COM aggregation with ATL. I've defined a base class, called CameraBase, that is only available through aggregation. Therefor I've added the aggregateable annotation to it's coclass-declaration. [ uuid(...), aggregatable ] coclass CameraBase { [default] int...
Carsten
1

votes
3

answer
0

Views

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 one into the other and then compiling back to .tlb...
Jambobond
1

votes
1

answer
0

Views

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 the interfaces are IDispatch-inherited, and __int326...
Hernán
1

votes
3

answer
0

Views

Why doesn't TlbImp import this COM interface for DIA correctly into .NET?

I tried to import Microsoft's DIA SDK for use with .NET: call '%VS90COMNTOOLS%\vsvars32.bat' midl /I '%VSINSTALLDIR%\DIA SDK\include' '%VSINSTALLDIR%\DIA SDK\idl\dia2.idl' /tlb dia2.tlb tlbimp dia2.tlb Which seems to work correctly for the most part, except that, for some reason, it doesn't include...
Mehrdad
1

votes
1

answer
501

Views

Visual Studio always compiles MIDL although non-changed

I have a project with several MIDL files, which VS ALWAYS recompiles despite them being unchanged. I've tried several tips, including putting the project dir in include path etc. but nothing helps. Problem is that there are header files generated that then affect the recompilation of other 'sub-proj...
Robert
1

votes
1

answer
70

Views

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, [out, size_is(*objCount)] MyObject myobj[*]); This...
miradham
1

votes
1

answer
63

Views

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 presence of a specific type of device and returns a...
Sean Kelly
1

votes
2

answer
1.9k

Views

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 file (let's just call it Decadence.cpp) of the same ATL COM projec...
ykay
1

votes
2

answer
568

Views

Create COM interface returning a pointer that is marshalled as IntPtr in C#

I want to declare a COM Interface in MIDL that allows for returning a pointer (like in the ID3D11Blob). I understand that pointers are a special thing in COM because of the stubs generated for RPC calls. I do not need RPC, but only want to access the COM server from C#. The question is: can I declar...
Christoph
1

votes
1

answer
1.6k

Views

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 attribute. When the MIDL compiler tries to compile...
Steiny
1

votes
1

answer
211

Views

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 MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ const type name = {l,w1,w...
2

votes
1

answer
741

Views

Get IDL code from TypeLibrary programmatically

I am writing code to perform the following steps; Register a .net .dll and generate a .tlb using regasm.exe Register a .net .dll and generate a .tlb using regasm.exe Generate the IDL code from the typeLibrary and store it in a file. Edit the IDL code making minor changes. Recompile the IDL into a .t...
Jambobond
5

votes
1

answer
59

Views

Consecutive interface function IDs

I have a COM object interface in midl like interface InterfaceName : IDispatch { [id(1)] HRESULT FunA(...); [id(2)] HRESULT FunB(...); [id(3)] HRESULT FunC(...); } Are the ids required to be consecutive? Or can I define it like interface InterfaceName : IDispatch { [id(1)] HRESULT FunA(...); [id(3)]...
chrizke
5

votes
2

answer
1.9k

Views

MIDL generates the same file for /env win32 and /env win64

In Visual Studio, when you compile foo.idl, MIDL generates the proxy information in foo_p.c. Unfortunately, for Win32 and x64 files, it uses the same filename. For Win32, the file starts with: #if !defined(_M_IA64) && !defined(_M_AMD64) For x64, the file starts with: #if defined(_M_AMD64) When you b...
Roger Lipscombe
5

votes
2

answer
1.5k

Views

Any sense in marking an IUnknown-derived interface as dual in IDL?

Reviewing our code I've found a curious definition in one of .idl files: [ object, uuid(uuidhere), dual, nonextensible, oleautomation, hidden ] interface IOurInterface : IUnknown { //methods here }; How can an interface derived directly from IUnknown possibly be a dual interface? Will anything break...
sharptooth
2

votes
1

answer
3.3k

Views

Issues Using Midl to create a .tlb from .idl “expecting a type specification”

I have been having a prolonged encounter with the beast known as COM Interop... I am currently trying to generate a .tlb from a .idl file generated by the OLE/COM Object Viewer. However when trying to run Midl.exe to compile it I get an error: .\Sim.API.IDL(236) : error MIDL2025 : syntax error : ex...
Jambobond
1

votes
1

answer
609

Views

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 bitwise-OR, same thing) of flags, e.g. (in IDL) HRESULT _std...
M.M
4

votes
1

answer
721

Views

VS2008 C++ compiler keeps asking to build the project [duplicate]

Possible Duplicate: Visual studio keeps building everything I have a project that includes an idl file that generates a .c file that is included in another file of the same project. I build this project and all is fine, I then try to run the project and I am told the project is out of date and woul...
Gary Miller
2

votes
1

answer
190

Views

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 server stubs for RPC calls. But, MIDL does not support higher level datatypes. So, is there any w...
Prerak Sola
2

votes
1

answer
1.1k

Views

COM coclass implementing interface from another type library

I'm relatively new in COM, so appologies if this is a stupid question. I'm having a bunch of COM interfaces compiled into a type library A. This type library is a resource in one of the DLLs (a.dll) in my solution. In a separate type library (B) that goes into a separate DLL (b.dll) I would like to...
themik81
5

votes
2

answer
556

Views

MIDL changes case of identifier when compiling IDL file

I've got a snippet of IDL that looks like this: [ object, uuid(...), pointer_default(unique) ] interface IVirtualMachine { /* ... */ } [ object, uuid(...), pointer_default(unique) ] interface IVirtualServer : IUnknown { HRESULT FindVirtualMachine( [in] BSTR configurationName, [out,retval] IVirtualMa...
Roger Lipscombe
3

votes
2

answer
1k

Views

MIDL marshaling array of structures using size_is in unmanaged c++

I’m trying to retrieve an array of structures through a COM interface. It works when the number of structures is 1. When the number of structures is greater than 1, only the first structure is marshaled correctly. The remaining structures in the array have garbage data. My interface looks like thi...
Ken

View additional questions