midl

How to add and implement a new interface to an Inproc COM server

淺唱寂寞╮ 提交于 2019-12-24 06:37:28
问题 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 seen, I think it should be possible to create a new COM interface, implement it in the deskband object (which I have access to via IBandSite), call QueryInterface() for my own interface on it and then use it to call directly into the deskband. I've

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

[亡魂溺海] 提交于 2019-12-24 04:17:12
问题 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 : expecting a type s pecification near "ImportFileStatus" My .idl file is more that 1000 lines long so I don't particularly want to post it here however, I believe the Part of interest is: typedef [uuid

Getting IDL (for TLB) from a COM+ dll when it is not provided

假装没事ソ 提交于 2019-12-23 11:49:35
问题 I have a .dll that contains some directshow filters (COM) with specific/custom interfaces to query. Most 3rd party directshow components contain embedded .tlb files that can be used for cross-enviroment communication (C# typelib import). I would hate to have to attempt to manually create the interfaces needed for c# because no idl/tlb files were provided. Is it possible to generate a tlb (or at least, an idl, which I can MIDL compile) from a COM .dll? 回答1: Yes, it is possible to reverse

How to read a winmd (WinRT metadata file)?

橙三吉。 提交于 2019-12-23 07:00:40
问题 A WinMD is a binary medadata file, that contains everything you need to learn about namespaces, types, classes, methods, parameters available in a native WinRT dll. From Windows Runtime design : The Windows Runtime is exposed using API metadata (.winmd files). This is the same format used by the .NET framework (Ecma-335). The underlying binary contract makes it easy for you to access the Windows Runtime APIs directly in the development language of your choice. Each .winmd file exposes one or

What do you do when MIDL can't create a tlb?

独自空忆成欢 提交于 2019-12-21 17:13:57
问题 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

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

雨燕双飞 提交于 2019-12-18 06:27:09
问题 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 if I remove the dual attribute? 回答1: In this answer to another question concerning marshaling user voyce points to this article that basically states the following: When any interface (IDispatch

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

倾然丶 夕夏残阳落幕 提交于 2019-12-18 06:25:46
问题 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 if I remove the dual attribute? 回答1: In this answer to another question concerning marshaling user voyce points to this article that basically states the following: When any interface (IDispatch

MIDL (Constant) References

坚强是说给别人听的谎言 提交于 2019-12-12 19:31:54
问题 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 ); 回答1: MIDL doesn't really support reference parameters, it only supports "in" and "out" parameters. So if you DO pass in a reference, it's just syntactic sugar for a pointer to the value (the issue is observability - if you have a callback function or interface in our method signature, changes to a

Syntax error while converting IDL to C header

别等时光非礼了梦想. 提交于 2019-12-12 11:46:02
问题 I am trying to get C header files for COM interfaces using OLE/COM object viewer. I have tries to save type library as header file in object viewer, however, after a cmd window flashes, nothing happens. I have tried to save it as IDL file and convert to header file myself using this command; midl /out C:\temp /header EXCEL.h EXCEL.IDL However, I am getting this error: Microsoft (R) 32b/64b MIDL Compiler Version 7.00.0555 Copyright (c) Microsoft Corporation. All rights reserved. 64 bit

No type definitions in pre-defined IDL FILE

被刻印的时光 ゝ 提交于 2019-12-11 17:17:53
问题 Firstly, Using plain C++, without ATL, MFC attempting to use COM Object interface. Using oleview (OLE/COM Object viewer) - used to engineer the IDL code. At this stage, using MIDL Compiler, now I'm having trouble trying to produce the following: Syntax on cmd line: midl /nologo /env win32 /tlb ".\S8_.tlb" /h ".\S8_.h" /iid ".\S8_i.c" S8.idl A corresponding .TLB (Type Library) A .H (header) An IID definitions include file (*_i.c) A proxy (*_p.c) MIDL compiler error: S8.IDL(513) : error