4

ATL と Microsoft の IDL を使用して記述した COM インターフェイスを備えた 2 つのタイプ ライブラリがあります。あるライブラリのインターフェイスを別のライブラリのインターフェイスから継承したいと考えています。

基本的には、Stevenが VS C++ で .tlb 型を使用してインターフェイス メソッドを作成するにはどうすればよいですか? で説明したのと同じことをしたいと思います。. 彼に答えた唯一の人は、質問を理解していないようでした。

コードでやりたいことは次のとおりです。


一部のライブラリ DLL/TLB

ISomeInterface.idl

interface ISomeInterface : IDispatch { ... };

SomeLibrary.idl

import "ISomeInterface.idl";

library SomeLibrary
{
    interface ISomeInterface;
};

SomeOtherLibrary DLL/TLB

ISomeOtherInterface.idl

// What do I put here so that the MIDL compiler knows
// what to do when it encounters the ISomeInterface type?

interface ISomeOtherInterface : ISomeInterface { ... };

SomeOtherLibrary.idl

import "ISomeOtherInterface.idl";

library SomeOtherLibrary
{
    interface ISomeOtherInterface;
};

MIDLimportディレクティブは、IDL ファイルのインポート時にのみ機能し、DLL と TLB しかありません。定義importlib内でしか機能しないため、使用できません。MIDL コンパイラは、Microsoft の C++ 、、および属性をlibrary認識しません。importimportidlimportlib

何をすべきか?

4

1 に答える 1

2

手動の手順を導入する場合は、oleview で tlb を開き、生成された .idl ファイルを取得できます。oleview.exe は、Windows SDK の bin ディレクトリにあります。

  C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\oleview.exe
于 2010-07-19T21:30:54.297 に答える