firemail

标题: xpcom常用定义函数 [打印本页]

作者: hechengjin    时间: 2016-4-23 17:40
标题: xpcom常用定义函数
本帖最后由 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;
};


作者: ribj0u    时间: 2016-5-16 20:59
不错啊! 一个字牛啊!












青春励志名言 www.li96.com/lizhimingyan/




欢迎光临 firemail (http://www.firemail.wang:8088/) Powered by Discuz! X3