www.pudn.com > GGBT.rar > Common.h
// Common.h: interface for the CCommon class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_COMMON_H__DA53EFA0_B9A5_4CEE_9F0D_8537E4EB983B__INCLUDED_)
#define AFX_COMMON_H__DA53EFA0_B9A5_4CEE_9F0D_8537E4EB983B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "memstream.h"
string formatDir(string strDir);
string ltostring(long lVal);
string WSAShowError();
bool IsEventSet(HANDLE hEvent);
bool DeleteDiretory(CString strOld);
class CWinsockInit
{
public:
~CWinsockInit()
{
WSACleanup();
}
CWinsockInit()
{
// init socket.
WORD wVersionRequested;
WSADATA wsaData;
wVersionRequested = MAKEWORD( 2, 2 );
int err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 )
{return;}
}
};
class CAddrPort
{
public:
CAddrPort(long lAddr, short sPort)
{
m_lAddr = lAddr;
m_sPort = sPort;
}
long m_lAddr;
short m_sPort;
};
#endif // !defined(AFX_COMMON_H__DA53EFA0_B9A5_4CEE_9F0D_8537E4EB983B__INCLUDED_)