-
Notifications
You must be signed in to change notification settings - Fork 3
/
DDEConv.cpp
57 lines (47 loc) · 1.29 KB
/
DDEConv.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/******************************************************************************
** (C) Chris Oldwood
**
** MODULE: DDECONV.CPP
** COMPONENT: Network & Comms Library
** DESCRIPTION: The CDDEConv class definition.
**
*******************************************************************************
*/
#include "Common.hpp"
#include "DDEConv.hpp"
#include "DDEInst.hpp"
////////////////////////////////////////////////////////////////////////////////
//! Constructor.
CDDEConv::CDDEConv(CDDEInst* pInst, HCONV hConv, const tchar* pszService, const tchar* pszTopic)
: m_pInst(pInst)
, m_hConv(hConv)
, m_strService(pszService)
, m_strTopic(pszTopic)
, m_pAppData(nullptr)
{
ASSERT(m_pInst != nullptr);
ASSERT(m_hConv != NULL);
ASSERT(!m_strService.Empty());
ASSERT(!m_strTopic.Empty());
}
////////////////////////////////////////////////////////////////////////////////
//! Destructor.
CDDEConv::~CDDEConv()
{
}
////////////////////////////////////////////////////////////////////////////////
//! Disconnect the conversation.
void CDDEConv::Disconnect()
{
if (m_hConv != NULL)
{
BOOL okay = ::DdeDisconnect(m_hConv);
if (!okay)
{
uint error = m_pInst->LastError();
TRACE1(TXT("WARNING: DdeDisconnect() returned error code 0x%08X\n"), error);
DEBUG_USE_ONLY(error);
}
}
m_hConv = NULL;
}