#ifndef _kbddeH
#define _kbddeH
//---------------------------------------------------------------------------
#include <ddeml.h>
///////////////////////////////////////////////////////////////////////////////
class KbDDE
{
protected:
    DWORD m_ddeInst;
    HSZ   m_hszService;
    HSZ   m_hszTopic;
public:
    KbDDE(PFNCALLBACK pfnCallBack, const TCHAR *czService, const TCHAR *cszTopic, DWORD afCmd);
    ~KbDDE(void);
};
///////////////////////////////////////////////////////////////////////////////
class KbDDEServer : public KbDDE
{
private:

public:
    DWORD __fastcall QueryString(HSZ hsz, TCHAR *pwszBuffer, int nSize);
    HDDEDATA __fastcall CreateDataHandle(LPBYTE pSrc, DWORD cb, HSZ hsz, UINT wFmt);
    KbDDEServer(PFNCALLBACK pfnCallBack, const TCHAR *cszService, const TCHAR *cszTopic);
    ~KbDDEServer(void);
};
///////////////////////////////////////////////////////////////////////////////
class KbDDEClient : public KbDDE
{
private:
    HCONV m_hConv;
public:
    bool __fastcall Execute(const TCHAR *cszCommand, DWORD dwWait);
    bool __fastcall Request(TCHAR** ppszReturn, const TCHAR *cszCommand, DWORD dwWait);
    KbDDEClient(PFNCALLBACK pfnCallBack, const TCHAR *cszService, const TCHAR *cszTopic);
    ~KbDDEClient(void);
};
///////////////////////////////////////////////////////////////////////////////
#endif

