FORMATETC *rgelt,
ULONG *pceltFetched)
{
- wxLogTrace("wxIEnumFORMATETC::Next");
+ wxLogTrace(_T("wxIEnumFORMATETC::Next"));
if ( celt > 1 )
return S_FALSE;
STDMETHODIMP wxIEnumFORMATETC::Skip(ULONG celt)
{
- wxLogTrace("wxIEnumFORMATETC::Skip");
+ wxLogTrace(_T("wxIEnumFORMATETC::Skip"));
if ( m_nCurrent == 0 )
m_nCurrent++;
STDMETHODIMP wxIEnumFORMATETC::Reset()
{
- wxLogTrace("wxIEnumFORMATETC::Reset");
+ wxLogTrace(_T("wxIEnumFORMATETC::Reset"));
m_nCurrent = 0;
STDMETHODIMP wxIEnumFORMATETC::Clone(IEnumFORMATETC **ppenum)
{
- wxLogTrace("wxIEnumFORMATETC::Clone");
+ wxLogTrace(_T("wxIEnumFORMATETC::Clone"));
wxIEnumFORMATETC *pNew = new wxIEnumFORMATETC(m_format.cfFormat);
pNew->AddRef();
// get data functions
STDMETHODIMP wxIDataObject::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium)
{
- wxLogTrace("wxIDataObject::GetData");
+ wxLogTrace(_T("wxIDataObject::GetData"));
// is data is in our format?
HRESULT hr = QueryGetData(pformatetcIn);
STDMETHODIMP wxIDataObject::GetDataHere(FORMATETC *pformatetc,
STGMEDIUM *pmedium)
{
- wxLogTrace("wxIDataObject::GetDataHere");
+ wxLogTrace(_T("wxIDataObject::GetDataHere"));
// put data in caller provided medium
if ( pmedium->tymed != TYMED_HGLOBAL )
// copy data
void *pBuf = GlobalLock(pmedium->hGlobal);
if ( pBuf == NULL ) {
- wxLogLastError("GlobalLock");
+ wxLogLastError(_T("GlobalLock"));
return E_OUTOFMEMORY;
}
STGMEDIUM *pmedium,
BOOL fRelease)
{
- wxLogTrace("wxIDataObject::SetData");
+ wxLogTrace(_T("wxIDataObject::SetData"));
return E_NOTIMPL;
}
{
// do we accept data in this format?
if ( pformatetc == NULL ) {
- wxLogTrace("wxIDataObject::QueryGetData: invalid ptr.");
+ wxLogTrace(_T("wxIDataObject::QueryGetData: invalid ptr."));
return E_INVALIDARG;
}
// the only one allowed by current COM implementation
if ( pformatetc->lindex != -1 ) {
- wxLogTrace("wxIDataObject::QueryGetData: bad lindex %d",
+ wxLogTrace(_T("wxIDataObject::QueryGetData: bad lindex %d"),
pformatetc->lindex);
return DV_E_LINDEX;
}
// we don't support anything other (THUMBNAIL, ICON, DOCPRINT...)
if ( pformatetc->dwAspect != DVASPECT_CONTENT ) {
- wxLogTrace("wxIDataObject::QueryGetData: bad dwAspect %d",
+ wxLogTrace(_T("wxIDataObject::QueryGetData: bad dwAspect %d"),
pformatetc->dwAspect);
return DV_E_DVASPECT;
}
// @@ we only transfer data by global memory (bad for large amounts of it!)
if ( !(pformatetc->tymed & TYMED_HGLOBAL) ) {
- wxLogTrace("wxIDataObject::QueryGetData: %s != TYMED_HGLOBAL.",
+ wxLogTrace(_T("wxIDataObject::QueryGetData: %s != TYMED_HGLOBAL."),
GetTymedName(pformatetc->tymed));
return DV_E_TYMED;
}
// and now check the type of data requested
if ( m_pDataObject->IsSupportedFormat((wxDataFormatId)pformatetc->cfFormat) ) {
- wxLogTrace("wxIDataObject::QueryGetData: %s ok",
+ wxLogTrace(_T("wxIDataObject::QueryGetData: %s ok"),
wxDataObject::GetFormatName((wxDataFormatId)pformatetc->cfFormat));
return S_OK;
}
else {
- wxLogTrace("wxIDataObject::QueryGetData: %s unsupported",
+ wxLogTrace(_T("wxIDataObject::QueryGetData: %s unsupported"),
wxDataObject::GetFormatName((wxDataFormatId)pformatetc->cfFormat));
return DV_E_FORMATETC;
}
STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatetcIn,
FORMATETC *pFormatetcOut)
{
- wxLogTrace("wxIDataObject::GetCanonicalFormatEtc");
+ wxLogTrace(_T("wxIDataObject::GetCanonicalFormatEtc"));
// @@ implementation is trivial, we might want something better here
if ( pFormatetcOut != NULL )
STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDirection,
IEnumFORMATETC **ppenumFormatEtc)
{
- wxLogTrace("wxIDataObject::EnumFormatEtc");
+ wxLogTrace(_T("wxIDataObject::EnumFormatEtc"));
if ( dwDirection == DATADIR_SET ) {
// we don't allow setting of data anyhow
// Notes : you must call SetData() before if you had used def ctor
wxDragResult wxDropSource::DoDragDrop(bool bAllowMove)
{
- wxCHECK_MSG( m_pData != NULL, wxDragNone, "No data in wxDropSource!" );
+ wxCHECK_MSG( m_pData != NULL, wxDragNone, _T("No data in wxDropSource!") );
DWORD dwEffect;
HRESULT hr = ::DoDragDrop(m_pData->GetInterface(),
else {
if ( FAILED(hr) ) {
wxLogApiError("DoDragDrop", hr);
- wxLogError("Drag & drop operation failed.");
+ wxLogError(_T("Drag & drop operation failed."));
}
else {
- wxLogDebug("Unexpected success return code %08lx from DoDragDrop.", hr);
+ wxLogDebug(_T("Unexpected success return code %08lx from DoDragDrop."), hr);
}
return wxDragError;
POINTL pt,
DWORD *pdwEffect)
{
- wxLogDebug("IDropTarget::DragEnter");
+ wxLogDebug(_T("IDropTarget::DragEnter"));
wxASSERT( m_pIDataObject == NULL );
// Notes : good place to do any clean-up
STDMETHODIMP wxIDropTarget::DragLeave()
{
- wxLogDebug("IDropTarget::DragLeave");
+ wxLogDebug(_T("IDropTarget::DragLeave"));
// remove the UI feedback
m_pTarget->OnLeave();
POINTL pt,
DWORD *pdwEffect)
{
- wxLogDebug("IDropTarget::Drop");
+ wxLogDebug(_T("IDropTarget::Drop"));
// TODO I don't know why there is this parameter, but so far I assume
// that it's the same we've already got in DragEnter
bool wxTextDropTarget::OnDrop(long x, long y, const void *pData)
{
- return OnDropText(x, y, (const char *)pData);
+ return OnDropText(x, y, (const wxChar *)pData);
}
size_t wxTextDropTarget::GetFormatCount() const
UINT nFiles = ::DragQueryFile(hdrop, (unsigned)-1, NULL, 0u);
// for each file get the length, allocate memory and then get the name
- char **aszFiles = new char *[nFiles];
+ wxChar **aszFiles = new wxChar *[nFiles];
UINT len, n;
for ( n = 0; n < nFiles; n++ ) {
// +1 for terminating NUL
len = ::DragQueryFile(hdrop, n, NULL, 0) + 1;
- aszFiles[n] = new char[len];
+ aszFiles[n] = new wxChar[len];
UINT len2 = ::DragQueryFile(hdrop, n, aszFiles[n], len);
if ( len2 != len - 1 ) {
- wxLogDebug("In wxFileDropTarget::OnDrop DragQueryFile returned %d "
- "characters, %d expected.", len2, len - 1);
+ wxLogDebug(_T("In wxFileDropTarget::OnDrop DragQueryFile returned %d "
+ "characters, %d expected."), len2, len - 1);
}
}
- bool bResult = OnDropFiles(x, y, nFiles, (const char**) aszFiles);
+ bool bResult = OnDropFiles(x, y, nFiles, (const wxChar**) aszFiles);
// free memory
for ( n = 0; n < nFiles; n++ ) {
// force the string to be allocated by RPC
// (we free it later with RpcStringFree)
+#ifdef _UNICODE
+ UuidToString(&m_uuid, (unsigned short **)&m_pszUuid);
+#else
UuidToString(&m_uuid, &m_pszUuid);
+#endif
// allocate new buffer
- m_pszCForm = new char[UUID_CSTRLEN];
+ m_pszCForm = new wxChar[UUID_CSTRLEN];
// and fill it
- memcpy(m_pszCForm, uuid.m_pszCForm, UUID_CSTRLEN);
+ memcpy(m_pszCForm, uuid.m_pszCForm, UUID_CSTRLEN*sizeof(wxChar));
}
// assignment operator
// force the string to be allocated by RPC
// (we free it later with RpcStringFree)
+#ifdef _UNICODE
+ UuidToString(&m_uuid, (unsigned short **)&m_pszUuid);
+#else
UuidToString(&m_uuid, &m_pszUuid);
+#endif
// allocate new buffer if not done yet
if ( !m_pszCForm )
- m_pszCForm = new char[UUID_CSTRLEN];
+ m_pszCForm = new wxChar[UUID_CSTRLEN];
// and fill it
- memcpy(m_pszCForm, uuid.m_pszCForm, UUID_CSTRLEN);
+ memcpy(m_pszCForm, uuid.m_pszCForm, UUID_CSTRLEN*sizeof(wxChar));
return *this;
}
// this string must be allocated by RPC!
// (otherwise you get a debug breakpoint deep inside RPC DLL)
if ( m_pszUuid )
+#ifdef _UNICODE
+ RpcStringFree((unsigned short **)&m_pszUuid);
+#else
RpcStringFree(&m_pszUuid);
+#endif
// perhaps we should just use a static buffer and not bother
// with new and delete?
m_uuid = uuid;
// get string representation
+#ifdef _UNICODE
+ UuidToString(&m_uuid, (unsigned short **)&m_pszUuid);
+#else
UuidToString(&m_uuid, &m_pszUuid);
+#endif
// cache UUID in C format
UuidToCForm();
}
// set the value
-bool Uuid::Set(const char *pc)
+bool Uuid::Set(const wxChar *pc)
{
// get UUID from string
- if ( UuidFromString((uchar *)pc, &m_uuid) != RPC_S_OK)
+#ifdef _UNICODE
+ if ( UuidFromString((unsigned short *)pc, &m_uuid) != RPC_S_OK)
+#else
+ if ( UuidFromString((wxUChar *)pc, &m_uuid) != RPC_S_OK)
+#endif
// failed: probably invalid string
return FALSE;
// transform it back to string to normalize it
+#ifdef _UNICODE
+ UuidToString(&m_uuid, (unsigned short **)&m_pszUuid);
+#else
UuidToString(&m_uuid, &m_pszUuid);
+#endif
// update m_pszCForm
UuidToCForm();
void Uuid::UuidToCForm()
{
if ( m_pszCForm == NULL )
- m_pszCForm = new char[UUID_CSTRLEN];
+ m_pszCForm = new wxChar[UUID_CSTRLEN];
- wsprintf(m_pszCForm, "0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X,"
- "0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X",
+ wsprintf(m_pszCForm, _T("0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X,"
+ "0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X"),
m_uuid.Data1, m_uuid.Data2, m_uuid.Data3,
m_uuid.Data4[1], m_uuid.Data4[2], m_uuid.Data4[3], m_uuid.Data4[4],
m_uuid.Data4[5], m_uuid.Data4[6], m_uuid.Data4[7], m_uuid.Data4[8]);