#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
-
// ----------------------------------------------------------------------------
// macros and constants
// ----------------------------------------------------------------------------
}
DWORD len = DdeGetData(returned_data, NULL, 0, 0);
+ len = (DWORD)ceil( double(len)/sizeof(wxChar) );
- wxChar *data = GetBufferAtLeast( len/sizeof(wxChar) );
+ wxChar *data = GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
_T("Buffer too small in wxDDEConnection::Request") );
(void) DdeGetData(returned_data, (LPBYTE)data, len, 0);
(void) DdeFreeDataHandle(returned_data);
if (size)
- *size = (int)len/sizeof(wxChar);
+ *size = len;
return data;
}
if (connection)
{
DWORD len = DdeGetData(hData, NULL, 0, 0);
+ len = (DWORD)ceil( double(len)/sizeof(wxChar) );
- wxChar *data = connection->GetBufferAtLeast( len/sizeof(wxChar) );
+ wxChar *data = connection->GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
_T("Buffer too small in _DDECallback (XTYP_EXECUTE)") );
if ( connection->OnExecute(connection->m_topicName,
data,
- (int)len/sizeof(wxChar),
+ (int)len,
(wxIPCFormat) wFmt) )
{
return (DDERETURN)(DWORD)DDE_FACK;
wxString item_name = DDEStringFromAtom(hsz2);
DWORD len = DdeGetData(hData, NULL, 0, 0);
+ len = (DWORD)ceil( double(len) / sizeof(wxChar) );
- wxChar *data = connection->GetBufferAtLeast( len/sizeof(wxChar) );
+ wxChar *data = connection->GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
_T("Buffer too small in _DDECallback (XTYP_EXECUTE)") );
connection->OnPoke(connection->m_topicName,
item_name,
data,
- (int)len/sizeof(wxChar),
+ (int)len,
(wxIPCFormat) wFmt);
return (DDERETURN)DDE_FACK;
wxString item_name = DDEStringFromAtom(hsz2);
DWORD len = DdeGetData(hData, NULL, 0, 0);
+ len = (DWORD)ceil( double(len) / sizeof(wxChar) );
- wxChar *data = connection->GetBufferAtLeast( len/sizeof(wxChar) );
+ wxChar *data = connection->GetBufferAtLeast( len );
wxASSERT_MSG(data != NULL,
_T("Buffer too small in _DDECallback (XTYP_ADVDATA)") );
if ( connection->OnAdvise(connection->m_topicName,
item_name,
data,
- (int)len/sizeof(wxChar),
+ (int)len,
(wxIPCFormat) wFmt) )
{
return (DDERETURN)(DWORD)DDE_FACK;