CList::Find()
Hi,
I have a:
typedef struct _CLIENTSOCKETS
{
CString o_Date;
CTime o_LoginTime;
CString o_Time;
CString o_TimeOnline;
CString o_PeerName;
long n_BytesIn;
long n_BytesOut;
CString o_BytesIn;
CString o_BytesOut;
UINT n_Port;
CSvrSocketComm* po_SvrSocketComm;
struct _CLIENTSOCKETS* p_Next;
struct _CLIENTSOCKETS* p_Prev;
} *PCLIENTSOCKETS, CLIENTSOCKETS;
and a :
CList<CLIENTSOCKETS,CLIENTSOCKETS&> o_ClientSockets;
I want to Find a certain CLIENTSOCKETS element in the CList.
CLIENTSOCKETS a;
pt_Position = o_ClientSockets.Find(a);
I get an error :
error C2678: binary '==' : no operator defined which takes a left-hand
operand of type 'const struct _CLIENTSOCKETS' (or there is no
acceptable conversion)
c:\program files\microsoft visual studio\vc98\mfc\include
\afxtempl.h(1036) : see reference to function template instantiation
'int __stdcall CompareElements(const struct _CLIENTSOCKETS *,const
struct _CLIENTSOCKETS *)' being compiled
Error executing cl.exe.
What i want is to store structures in the CList and then removing one
of them using a search key for which to remove.
What am i doing wrong ?