#include <string.h>
#include <ddeml.h>
+#include <math.h>
// ----------------------------------------------------------------------------
// macros and constants
}
DWORD len = DdeGetData(returned_data, NULL, 0, 0);
+ len = ceil( static_cast<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 = ceil( static_cast<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 = ceil( static_cast<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 = ceil( static_cast<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;