Re: Unhandled Exception in XMPP (General questions)
Also if i comment the statement which was causing the unhandled exception, It went on and ask for login and password, After that it ask for to whom i need to send the message and what, after providing the details it calls SendText but i get following error message
The value of ESP was not properly saved across a function call. This is usually a result of calling a function pointer declared with a different calling convention.
Here the whole code
[code]
//#import c:windowssystem32wodxmpp.dll no_namespace named_guids
#include wodxmpp.tlh
#include <atlbase.h>
CComModule _Module; // dummy required to utilize atlcom.h
#include <atlcom.h>
bool error = false;
// Define the wodXMMP events to be handled:
_ATL_FUNC_INFO OnConnectedInfo = {CC_STDCALL, VT_EMPTY, 0, VT_EMPTY};
_ATL_FUNC_INFO OnDisconnectedInfo = {CC_STDCALL, VT_EMPTY, 2, {VT_I4, VT_BSTR}};
class wodXMPPEvents : public IDispEventSimpleImpl<1, wodXMPPEvents, &DIID__IwodXMPPComEvents>
{
public:
wodXMPPEvents (IwodXMPPComPtr pwodXMPPCom)
{
m_pwodXMPPCom = pwodXMPPCom;
DispEventAdvise ( (IUnknown*)pwodXMPPCom);
}
virtual ~wodXMPPEvents ()
{
DispEventUnadvise ( (IUnknown*)m_pwodXMPPCom);
m_pwodXMPPCom.Release();
}
void __stdcall OnConnected ()
{
printf(
Connected, continuing....
);
}
void __stdcall OnDisconnected (long ErrorCode, BSTR ErrorText)
{
if (ErrorCode)
{
error = true;
_bstr_t err(ErrorText);
printf(
s
, (char *)err);
}
else
printf(
Done and disconnected
);
}
BEGIN_SINK_MAP (wodXMPPEvents)
SINK_ENTRY_INFO (1, DIID__IwodXMPPComEvents, 0, OnConnected, &OnConnectedInfo)
SINK_ENTRY_INFO (1, DIID__IwodXMPPComEvents, 1, OnDisconnected, &OnDisconnectedInfo)
END_SINK_MAP ()
private:
IwodXMPPComPtr m_pwodXMPPCom;
};
int main(int argc, char* argv[])
{
IwodXMPPComPtr pXMPP;
HRESULT hr = NULL;
CoInitialize (NULL);
hr = pXMPP.CreateInstance (CLSID_wodXMPPCom, NULL);
if (FAILED (hr))
{
_com_error comErr (hr);
printf ( Unable to load IwodXMPPCom interface.
Err # u: s , hr, comErr.ErrorMessage () );
CoUninitialize ();
return 99;
}
wodXMPPEvents *pEvents = new wodXMPPEvents(pXMPP);
//This was creating problem, Now i commented it.
//pXMPP->Blocking = VARIANT_FALSE;
//pXMPP->Register = VARIANT_TRUE; // register new account
VARIANT var;
var.vt = VT_ERROR;
char Login[256];
char Password[256];
printf( This sample will let you login to your Jabber account and send a message to one of your contacts.
);
printf( Enter your JID: );
scanf( s , Login);
printf( Enter your password: );
scanf( s , Password);
pXMPP->Login = _bstr_t(Login);
pXMPP->Password = _bstr_t(Password);
try
{
hr = pXMPP->Connect(var);
}
catch (_com_error e)
{
error = true;
}
if (!error)
{
char JID[256];
char message[1024];
printf( Send message to (JID): );
scanf( s , JID);
printf( Message: );
scanf(
[^
] ,message); //reads whole line from console
//pXMPP->Contacts->Add(_bstr_t( someone@wippien.com ))->Subscribe(); // you can add someone to your contact list...
//Now here it shows the error message.
pXMPP->SendText(_bstr_t(JID), _bstr_t(message));
pXMPP->Disconnect();
}
delete pEvents;
pXMPP.Release();
CoUninitialize ();
return 0;
}
[/code]
Looking forward for quick reply..
Thanks.
Complete thread:
- Unhandled Exception in XMPP - gothic_coder, 2010-12-10, 14:22
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-10, 15:00
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-11, 08:11
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-11, 10:26
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-12, 12:57
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-13, 07:57
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-13, 15:21
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-13, 15:25
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 07:19
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 08:51
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 10:09
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 10:53
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 11:18
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 11:43
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 11:48
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 13:19
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 14:15
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 15:33
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 15:40
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 16:03
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 07:28
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 09:04
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 10:38
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 11:37
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 12:31
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 12:41
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 12:44
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 13:07
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 13:11
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 13:32
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 13:11
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 13:07
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 12:44
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 12:41
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 12:31
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 11:37
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 10:38
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-15, 09:04
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-15, 07:28
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 16:03
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 15:40
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 15:33
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 14:15
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 13:19
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 11:48
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 11:43
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 11:18
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 10:53
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 10:09
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-14, 08:51
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-14, 07:19
- Re: Unhandled Exception in XMPP - woddrazen, 2010-12-13, 15:25
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-13, 15:21
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-13, 07:57
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-12, 12:57
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-11, 10:26
- Re: Unhandled Exception in XMPP - gothic_coder, 2010-12-11, 08:11
- Re: Unhandled Exception in XMPP - wodDamir, 2010-12-10, 15:00