LInet::m_pUserDataEx
#include "ltwrappr.h"
L_VOID *LInet::m_pUserDataEx
Comments
A void pointer to be used for any extra data the user needs.
Required DLLs and Libraries
LTNET For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Example
class LUserInet : public LInet { protected: virtual L_INT OnConnect(LInet *plConnection, L_INT nError); virtual L_INT OnClose(LInet *plConnection, L_INT nError); }; L_INT LInet__m_pUserDataExExample() { L_INT nRet; LUserInet UserInet; nRet = UserInet.StartUp(); if(nRet != SUCCESS) return nRet; // connect to LEAD. nRet = UserInet.Connect("207.238.49.190", 1000); if(nRet != SUCCESS) return nRet; // … other operations; LInet *plConnection = UserInet.GetFirstItem(); if(plConnection) { nRet = plConnection->Close(FALSE); if(nRet != SUCCESS) return nRet; if(plConnection->m_pUserDataEx) { MessageBox(NULL, TEXT(" User Data "), (L_TCHAR *)plConnection->m_pUserDataEx, MB_OK| MB_APPLMODAL); // free the m_pUserDataEx; delete []plConnection->m_pUserDataEx; plConnection->m_pUserDataEx = NULL; } } return SUCCESS; } // Callback functions L_INT LUserInet::OnConnect(LInet *plConnection, L_INT nError) { UNREFERENCED_PARAMETER(plConnection); UNREFERENCED_PARAMETER(nError); if(plConnection) { L_TCHAR* name = TEXT("This is Data for user"); plConnection->m_pUserDataEx = (L_VOID *)new L_TCHAR[50]; memcpy(plConnection->m_pUserDataEx, name, lstrlen(name)); } return 0; } L_INT LUserInet::OnClose(LInet *plConnection, L_INT nError) { UNREFERENCED_PARAMETER(nError); if(plConnection && plConnection->m_pUserDataEx) { MessageBox(NULL,TEXT(" User Data "), (L_TCHAR *)plConnection->m_pUserDataEx,MB_OK| MB_APPLMODAL); delete []plConnection->m_pUserDataEx; plConnection->m_pUserDataEx = NULL; } return 0; }