社区
ATL
帖子详情
一个关于COM接口的很简单的问题,高手们闭着眼睛都可以回答的
ajet
2002-06-24 09:20:23
只知一个Interface的GUID为"6C44DF74-72B9-4992-A1EC-EF996E0422D4",其它的什么都不知道的情况下,怎么得到它的CComPtr指针?请指教,谢谢!
...全文
160
7
打赏
收藏
一个关于COM接口的很简单的问题,高手们闭着眼睛都可以回答的
只知一个Interface的GUID为"6C44DF74-72B9-4992-A1EC-EF996E0422D4",其它的什么都不知道的情况下,怎么得到它的CComPtr指针?请指教,谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
maphis
2002-06-24
打赏
举报
回复
你如果不知道CLSID的话,那么就意味着不能创建相应的实例,所以当然不能得到。
相关原理可以看看讲COM的书。
ajet
2002-06-24
打赏
举报
回复
到底能不能得到?
ultraboy
2002-06-24
打赏
举报
回复
其他什么都不知道,你得到指针能干嘛?
ajet
2002-06-24
打赏
举报
回复
maphis(bool bPoor=true) :谢谢你,谢谢你,太感谢你了!!!(真想亲你一口)
maphis
2002-06-24
打赏
举报
回复
有重定义发生,你可以去掉no_namespace参数,这样你使用的时候注意要加上namespace就可以了。
ajet
2002-06-24
打赏
举报
回复
volcary((冰火山):
我在导出类型库时出错,我是想导出MICROSOFT TTS 引擎的,在StdAfx.h中加入
#import "C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll" no_namespace
后编译出错,提示如下:
Compiling...
StdAfx.cpp
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding 'wireHWND' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding '_RemotableHandle' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding '__MIDL_IWinTypes_0009' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding 'IStream' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding 'ISequentialStream' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding '_LARGE_INTEGER' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding '_ULARGE_INTEGER' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding 'tagSTATSTG' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\stdafx.h(23) : warning C4192: automatically excluding '_FILETIME' while importing type library 'C:\Program Files\Common Files\Microsoft Shared\Speech\sapi.dll'
d:\abcddd\b\debug\sapi.tlh(3515) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3515) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3515) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3516) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3516) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3516) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3517) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3517) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3517) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3517) : warning C4129: 'A' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3518) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3518) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3518) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3518) : warning C4129: 'A' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3519) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3519) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3519) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3519) : warning C4129: 'V' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3520) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3520) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3520) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3520) : warning C4129: 'R' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3521) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3521) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3521) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3521) : warning C4129: 'A' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3522) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3522) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3522) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3522) : warning C4129: 'P' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3523) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3523) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3523) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3523) : warning C4129: 'R' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3524) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3524) : warning C4129: 'M' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3524) : warning C4129: 'S' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3524) : warning C4129: 'C' : unrecognized character escape sequence
d:\abcddd\b\debug\sapi.tlh(3551) : warning C4305: 'initializing' : truncation from 'const double' to 'const float'
d:\abcddd\b\debug\sapi.tlh(4511) : error C2011: 'IServiceProvider' : 'struct' type redefinition
d:\abcddd\b\debug\sapi.tlh(6132) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
d:\abcddd\b\debug\sapi.tlh(6695) : error C2039: 'RemoteQueryService' : is not a member of 'IServiceProvider'
c:\program files\microsoft visual studio\vc98\include\servprov.h(108) : see declaration of 'IServiceProvider'
Error executing cl.exe.
Creating browse info file...
b.exe - 2 error(s), 49 warning(s)
volcary
2002-06-24
打赏
举报
回复
1.在HKEY_CLASSES_ROOT\Interface\ 找到
项“6C44DF74-72B9-4992-A1EC-EF996E0422D4”
2.在其项TypeLib下找到GUID是CLSID
3.在HKEY_CLASSES_ROOT\CLSID\ 找到 该CLSID_GUID其中
如果是进程外则找\localserver其中就是本地COM组件
如果是进程内找\InProcServer32
4.注册你的DLL yourcom.dll -regserver32
5.#import "youcom.dll" no_namespace
6.定义 yourcomclassPtr cominter
7.cominter.cocreateinstance()
......//调用
8.cominter.Release();
学弟学妹要的Java学习路线我终于写完了
最后
回答
几个常见
问题
(FAQ) 这篇文章写的非常认真,足足花了两周时间,不是
简单
的资料聚合,我将多年的工作和学习经验写下来了,相信看完后你能有一种豁然开朗的感觉,这就是我要达到的目的,希望不要被打脸。 ...
Java入门到架构师知识点整理,P8的技术大咖是这样通关的
一个
人最怕的不是路途遥远,而是看不到胜利曙光。我希望下面这篇文章能给你的学习之路带来一丝曙光,大家不妨试着读一下吧,如果有收获给我点个赞哟。 温馨提醒:这篇文章写着写着就一万字了,建议大家关注后再收藏...
一个
URL请求背后的逻辑
背景 本文来自于之前我发的一篇微博: ...不过写这篇文章并不是为了...第
一个
问题
:从输入 URL 到浏览器接收的过程中发生了什么事情? 从触屏到 CPU 首先是「输入 URL」,大部分人的第一反应会是键盘,不过
完整的Java从小白到大牛的自学路线
所以我在寻思着能不能写
一个
学习的地图或者路线,让读者能知道下一步该学什么,自己离大厂的 offer还有多远的距离。
一个
人最怕的不是路途遥远,而是看不到胜利曙光。这篇文章主要内容包括(干货满满):学Java有哪些...
万字Java知识地图助你成为Offer收割机
所以我在寻思着能不能写
一个
学习的地图或者路线,让读者能知道下一步该学什么,自己离大厂的 offer还有多远的距离。
一个
人最怕的不是路途遥远,而是看不到胜利曙光。这篇文章主要内容包括(干货满满):学Java有哪些...
ATL
3,245
社区成员
48,537
社区内容
发帖
与我相关
我的任务
ATL
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
复制链接
扫一扫
分享
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章