[JDEV] (HELP!) How to get a JabberSession pointer from JabberCOM
dai_jin at 21cn.com
dai_jin at 21cn.com
Fri Feb 23 01:46:12 CST 2001
Hi Mike,
I have solved the problem on your help. Thank you very much. But another problem appeared. I use these
code to connect the server:
pSession->PutServer(L"vista.internal");
pSession->PutUsername(L"dddd");
pSession->PutPassword(L"dddd");
pSession->PutResource(L"dddd");
pSession->PutPort(5222);
pSession->PutStatus(L"Working");
pSession->DoConnect(false, JabberAuthType(5));
But it return a Runtime error: abnormal program termination
I think i should missed something, right?
Any help would be greatly appreciated. Thanks!
Jim
>
> 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
>
>
>
>
> _______________________________________________
> 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
More information about the JDev
mailing list