我想得到包含 IConnectionPointContainer,IConnectionPoint这些接口定义的TLB文件,谁知道哪里有?

han012 2002-12-04 04:38:01
我想找到或自己做一个包含如下接口(系统定义的)类型库文件(.TLB文件),
谁知道哪儿有,或者如何自己生成?

uuid(B196B284-BAB4-101A-B69C-00AA00341D07)
interface IConnectionPointContainer : IUnknown

uuid(B196B285-BAB4-101A-B69C-00AA00341D07)
interface IEnumConnectionPoints : IUnknown

uuid(B196B286-BAB4-101A-B69C-00AA00341D07)
interface IConnectionPoint : IUnknown

uuid(B196B287-BAB4-101A-B69C-00AA00341D07)
interface IEnumConnections : IUnknown

再次强调,我要的是包含以上系统接口定义的TLB文件,
用VC工具"OLE/COM Object Viewer"可以看到的TLB文件. 谢谢
...全文
127 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
han012 2002-12-06
  • 打赏
  • 举报
回复
To paul2002():

I tried to compile it again according to your hint,
the result is Ok! Thank you very much.

I will close this TIEZI tonight.
paul2002 2002-12-06
  • 打赏
  • 举报
回复
TO han012(阿毛) :
In the file setting ,remove the MkTyplib Compatible choice.
See "MkTypLib [MIDL]" in MSDN.
han012 2002-12-06
  • 打赏
  • 举报
回复
To purpleclouds(purpleclouds):

I received your TLB file and I can open it by the tool of "Ole view".

Thanks for helping me though I didn't find the information about connection point from it.

I will increase the score point to this TIEZI

han012 2002-12-06
  • 打赏
  • 举报
回复
To paul2002():

Thank you for your wonderful example. It is just what I want.

I have succeed in compiling it after I removed the following
forward declaration statements from the outside of library block to
the inside of library block, like:

library YourLib
{
interface IEnumConnections;
interface IEnumConnectionPoints;
interface IConnectionPoint;
interface IConnectionPointContainer;
… …
}

The reason to do so because of the following compiler error:

“MIDL2311: statements outside library block are illegal in mktyplib compatability mode : [ ]”
purpleclouds 2002-12-05
  • 打赏
  • 举报
回复
俺有一个极丰富的TLB,怎么发给你?
paul2002 2002-12-05
  • 打赏
  • 举报
回复
新建一个idl文件,把下面定义拷过去,用midl编译一下,就有类型库了。
import "oleidl.idl";
import "oaidl.idl";
import "servprov.idl";
import "urlmon.idl";

interface IEnumConnections;
interface IEnumConnectionPoints;
interface IConnectionPoint;
interface IConnectionPointContainer;

[
uuid(11111111-99E6-11D3-8366-0060081AEB5F),
version(1.0),
helpstring("x 1.0 Type Library")
]
library YourLib
{

[
object,
uuid(B196B287-BAB4-101A-B69C-00AA00341D07),
pointer_default(unique)
]
interface IEnumConnections : IUnknown
{
typedef IEnumConnections * PENUMCONNECTIONS;
typedef IEnumConnections * LPENUMCONNECTIONS;

typedef struct tagCONNECTDATA {
IUnknown * pUnk;
DWORD dwCookie;
} CONNECTDATA;

typedef struct tagCONNECTDATA * PCONNECTDATA;
typedef struct tagCONNECTDATA * LPCONNECTDATA;

[local]
HRESULT Next(
[in] ULONG cConnections,
[out, size_is(cConnections), length_is(*pcFetched)]
LPCONNECTDATA rgcd,
[out] ULONG * pcFetched
);

[call_as(Next)]
HRESULT RemoteNext(
[in] ULONG cConnections,
[out, size_is(cConnections), length_is(*pcFetched)]
LPCONNECTDATA rgcd,
[out] ULONG * pcFetched
);

HRESULT Skip(
[in] ULONG cConnections
);

HRESULT Reset(
void
);

HRESULT Clone(
[out] IEnumConnections ** ppEnum
);
}


[
object,
uuid(B196B286-BAB4-101A-B69C-00AA00341D07),
pointer_default(unique)
]

interface IConnectionPoint : IUnknown
{
typedef IConnectionPoint * PCONNECTIONPOINT;
typedef IConnectionPoint * LPCONNECTIONPOINT;

HRESULT GetConnectionInterface(
[out] IID * pIID
);

HRESULT GetConnectionPointContainer(
[out] IConnectionPointContainer ** ppCPC
);

HRESULT Advise(
[in] IUnknown * pUnkSink,
[out] DWORD * pdwCookie
);

HRESULT Unadvise(
[in] DWORD dwCookie
);

HRESULT EnumConnections(
[out] IEnumConnections ** ppEnum
);
}


[
object,
uuid(B196B285-BAB4-101A-B69C-00AA00341D07),
pointer_default(unique)
]

interface IEnumConnectionPoints : IUnknown
{
typedef IEnumConnectionPoints * PENUMCONNECTIONPOINTS;
typedef IEnumConnectionPoints * LPENUMCONNECTIONPOINTS;

[local]
HRESULT Next(
[in] ULONG cConnections,
[out, size_is(cConnections), length_is(*pcFetched)]
LPCONNECTIONPOINT * ppCP,
[out] ULONG * pcFetched
);

[call_as(Next)]
HRESULT RemoteNext(
[in] ULONG cConnections,
[out, size_is(cConnections), length_is(*pcFetched)]
LPCONNECTIONPOINT * ppCP,
[out] ULONG * pcFetched
);

HRESULT Skip(
[in] ULONG cConnections
);

HRESULT Reset(
void
);

HRESULT Clone(
[out] IEnumConnectionPoints ** ppEnum
);
}


[
object,
uuid(B196B284-BAB4-101A-B69C-00AA00341D07),
pointer_default(unique)
]

interface IConnectionPointContainer : IUnknown
{
typedef IConnectionPointContainer * PCONNECTIONPOINTCONTAINER;
typedef IConnectionPointContainer * LPCONNECTIONPOINTCONTAINER;

HRESULT EnumConnectionPoints
(
[out] IEnumConnectionPoints ** ppEnum
);

HRESULT FindConnectionPoint
(
[in] REFIID riid,
[out] IConnectionPoint ** ppCP
);
}
};
han012 2002-12-05
  • 打赏
  • 举报
回复
my e-mail address:

hanjin@pecan.com.cn

thanks in advance.
han012 2002-12-04
  • 打赏
  • 举报
回复
接口中至少要包含以下系统接口定义:

uuid(B196B284-BAB4-101A-B69C-00AA00341D07)
interface IConnectionPointContainer : IUnknown

uuid(B196B285-BAB4-101A-B69C-00AA00341D07)
interface IEnumConnectionPoints : IUnknown

uuid(B196B286-BAB4-101A-B69C-00AA00341D07)
interface IConnectionPoint : IUnknown

uuid(B196B287-BAB4-101A-B69C-00AA00341D07)
interface IEnumConnections : IUnknown

以上接口用于对象连接点控制. 谢谢

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧