Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1925|回复: 1
打印 上一主题 下一主题

xpcom常用定义函数

[复制链接]

388

主题

602

帖子

2218

积分

金牌会员

Rank: 6Rank: 6

积分
2218
跳转到指定楼层
楼主
发表于 2016-4-23 17:40:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 hechengjin 于 2016-4-23 17:45 编辑

sCOMPtr<nsISupports> instance = do_GetService(contractID);
http://mxr.mozilla.org/comm-esr1 ... ceManagerUtils.h#28

inline
const nsGetServiceByContractID
do_GetService(const char* aContractID)
{
    return nsGetServiceByContractID(aContractID);
}



class NS_COM_GLUE nsGetServiceByContractID
{
public:
    explicit nsGetServiceByContractID(const char* aContractID)
        : mContractID(aContractID)
        {
            // nothing else to do
        }

    nsresult NS_FASTCALL operator()( const nsIID&, void** ) const;

private:
    const char*                 mContractID;
};

回复

使用道具 举报

0

主题

2

帖子

10

积分

新手上路

Rank: 1

积分
10
沙发
发表于 2016-5-16 20:59:34 | 只看该作者
不错啊! 一个字牛啊!












青春励志名言 www.li96.com/lizhimingyan/
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|firemail ( 粤ICP备15085507号-1 )

GMT+8, 2024-4-25 02:42 , Processed in 0.055159 second(s), 18 queries .

Powered by Discuz! X3

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表