[JDEV] (HELP!) How to get a JabberSession pointer from JabberCOM

Michael F Lin Michael_F_Lin at us.ibm.com
Thu Feb 22 13:53:23 CST 2001


Jim,

Make sure you are calling CoInitialize( NULL ) in the thread. If this does
not help you must examine the HRESULT returned to determine what the
problem is. You can use the compiler support class _com_error to extract an
error description as a string. Read more about this in the MSDN
documentation.

-Mike

dai_jin at 21cn.com@jabber.org on 02/22/2001 04:46:00 AM

Please respond to jdev at jabber.org

Sent by:  jdev-admin at jabber.org


To:   jdev at jabber.org
cc:
Subject:  Re: Re: [JDEV] (HELP!) How to get a JabberSession pointer from
      JabberCOM



Hi Mike,

    Thanks for your help.
    I tried to change the __uuidof(IJabberSession) to
__uuidof(JabberSession), but i still got error. Indeed, i tried using
CLSID(f6c7a239-b7b1-11d3-aecb-00a076a018e8). I still can't get the pointer.
Can anyone help me?

Thanks very much.
Jim

>
> Hi Jim,
>
> The problem here is in __uuidof(IJabberSession). This gives you the GUID
of
> the IJabberSession interface. However, what you want to pass to
> CreateInstance is the GUID of a class, not of an interface. I'm not
exactly
> sure how #import would have decided to declare the JabberSession class,
but
> you might try __uuidof(JabberSession) or CLSID_JabberSession.
>
> Hope this helps,
> Mike Lin
> mflin at us.ibm.com
>
> dai_jin at 21cn.com@jabber.org on 02/21/2001 08:35:38 AM
>
> Please respond to jdev at jabber.org
>
> Sent by:  jdev-admin at jabber.org
>
>
> To:   jdev at jabber.org
> cc:
> Subject:  [JDEV] (HELP!) How to get a JabberSession pointer from
JabberCOM
>
>
>
> I imported JabberCOM and used following code:
>
> IJabberSessionPtr pSession;
> HRESULT hr;
> hr = pMsg.CreateInstance(__uuidof(IJabberSession));
> if (SUCCEEDED(hr))
> {...}
>
> but i always get an error(SUCCEEDED(hr) is FALSE).
> What i missed?
>
> thanks.
> Jim
> ----------------------------------------------
> »¶Ó­Ê¹Óà 21CN µç×ÓÓʼþϵͳ http://www.21cn.com
> Thank you for using 21cn.com Email system
>
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
>
>
>
>
> _______________________________________________
> jdev mailing list
> jdev at jabber.org
> http://mailman.jabber.org/listinfo/jdev
----------------------------------------------
»¶Ó­Ê¹Óà 21CN µç×ÓÓʼþϵͳ http://www.21cn.com
Thank you for using 21cn.com Email system


_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev







More information about the JDev mailing list