Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unicode data for DdeCreateDataHandle() call

53 views
Skip to first unread message

NoSpam

unread,
Aug 1, 2005, 5:38:03 PM8/1/05
to
Hi, How can I create a Unicode data handle? We used to call
DdeCreateDataHandle() and subsequent DdeClientTransaction() before we ported
to Unicode, such as,

LPCTSTR lpszString = T2A((LPTSTR)(LPCTSTR) strString );
HDDEDATA hData1 = DdeCreateDataHandle( m_dwID,
(unsigned char*)lpszString,
(_tcslen( lpszString
)+1)*sizeof(TCHAR), 0L, 0L, 0, 0 );
HDDEDATA hData2 = DdeClientTransaction( (LPBYTE)hData1, .......);

Now with _UNICODE defined, the above stopped working.
Is there anything I miss?

TIA.

Martin Richter [MVP]

unread,
Aug 2, 2005, 4:55:00 AM8/2/05
to
Hallo NoSpam!

There are no different version for DdeCreateDataHandle in Unicode and
MBCS! The data handle you create just depends on the clipboardformat you
choose and transfer.

Your way to transmit the data should not change.
Strange to me is that you use the clipboard format 0. From my point of
view this is an error!
Either use CF_TEXT and store the data in MBCS or use CF_UNICODETEXT.

--
Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com

NoSpam

unread,
Aug 2, 2005, 7:49:07 AM8/2/05
to
Thanks a million!
0 new messages