// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWidgets licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
#include "wx/dde.h"
#include "wx/intl.h"
#include "wx/hashmap.h"
+#include "wx/math.h"
#include "wx/msw/private.h"
#include <string.h>
#include <ddeml.h>
-#ifdef __GNUWIN32_OLD__
- #include "wx/msw/gnuwin32/extra.h"
-#endif
-
-// some compilers headers don't define this one (mingw32)
-#ifndef DMLERR_NO_ERROR
- #define DMLERR_NO_ERROR (0)
-
- // this one is also missing from some mingw32 headers, but there is no way
- // to test for it (I know of) - the test for DMLERR_NO_ERROR works for me,
- // but is surely not the right thing to do
- extern "C"
- HDDEDATA STDCALL DdeClientTransaction(LPBYTE pData,
- DWORD cbData,
- HCONV hConv,
- HSZ hszItem,
- UINT wFmt,
- UINT wType,
- DWORD dwTimeout,
- LPDWORD pdwResult);
-#endif // no DMLERR_NO_ERROR
-
// ----------------------------------------------------------------------------
// macros and constants
// ----------------------------------------------------------------------------
wxDDEServer::~wxDDEServer()
{
- if ( !!m_serviceName )
+ if ( !m_serviceName.IsEmpty() )
{
HSZ hsz = DDEAtomFromString(m_serviceName);
size = wxStrlen(data) + 1;
}
- bool ok = DdeClientTransaction((LPBYTE)data, size,
+ bool ok = DdeClientTransaction((LPBYTE)data,
+ size * sizeof(wxChar),
GetHConv(),
NULL,
format,
}
DWORD len = DdeGetData(returned_data, NULL, 0, 0);
+ len = (DWORD)ceil( double(len)/sizeof(wxChar) );
wxChar *data = GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
(void) DdeFreeDataHandle(returned_data);
if (size)
- *size = (int)len;
+ *size = len;
return data;
}
}
HSZ item_atom = DDEGetAtom(item);
- bool ok = DdeClientTransaction((LPBYTE)data, size,
+ bool ok = DdeClientTransaction((LPBYTE)data,
+ size * sizeof(wxChar),
GetHConv(),
item_atom, format,
XTYP_POKE,
if (connection)
{
DWORD len = DdeGetData(hData, NULL, 0, 0);
+ len = (DWORD)ceil( double(len)/sizeof(wxChar) );
wxChar *data = connection->GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
HDDEDATA handle = DdeCreateDataHandle(DDEIdInst,
(LPBYTE)data,
- user_size,
+ user_size*sizeof(wxChar),
0,
hsz2,
wFmt,
wxString item_name = DDEStringFromAtom(hsz2);
DWORD len = DdeGetData(hData, NULL, 0, 0);
+ len = (DWORD)ceil( double(len) / sizeof(wxChar) );
wxChar *data = connection->GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
(
DDEIdInst,
(LPBYTE)connection->m_sendingData,
- connection->m_dataSize,
+ connection->m_dataSize*sizeof(wxChar),
0,
hsz2,
connection->m_dataType,
wxString item_name = DDEStringFromAtom(hsz2);
DWORD len = DdeGetData(hData, NULL, 0, 0);
+ len = (DWORD)ceil( double(len) / sizeof(wxChar) );
wxChar *data = connection->GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,