您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wxLogApiError函数代码示例

51自学网 2021-06-03 10:10:33
  C++
这篇教程C++ wxLogApiError函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中wxLogApiError函数的典型用法代码示例。如果您正苦于以下问题:C++ wxLogApiError函数的具体用法?C++ wxLogApiError怎么用?C++ wxLogApiError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了wxLogApiError函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wxCHECK_MSG

bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode){    wxWindow *winTop = wxTheApp->GetTopWindow();    wxCHECK_MSG( winTop, false, wxT("top level window required for DirectX") );    HRESULT hr = m_pDD2->SetCooperativeLevel                         (                            GetHwndOf(winTop),                            DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN                         );    if ( FAILED(hr) )    {        wxLogApiError(wxT("IDirectDraw2::SetCooperativeLevel"), hr);        return false;    }    hr = m_pDD2->SetDisplayMode(mode.w, mode.h, mode.bpp, mode.refresh, 0);    if ( FAILED(hr) )    {        wxLogApiError(wxT("IDirectDraw2::SetDisplayMode"), hr);        return false;    }    return true;}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:27,


示例2: memset

bool wxTaskBarButtonImpl::InitOrUpdateThumbBarButtons(){    THUMBBUTTON buttons[MAX_BUTTON_COUNT];    HRESULT hr;    for ( size_t i = 0; i < MAX_BUTTON_COUNT; ++i )    {        memset(&buttons[i], 0, sizeof buttons[i]);        buttons[i].iId = i;        buttons[i].dwFlags = THBF_HIDDEN;        buttons[i].dwMask = static_cast<THUMBBUTTONMASK>(THB_FLAGS);    }    for ( size_t i = 0; i < m_thumbBarButtons.size(); ++i )    {        buttons[i].hIcon = GetHiconOf(m_thumbBarButtons[i]->GetIcon());        buttons[i].dwFlags = GetNativeThumbButtonFlags(*m_thumbBarButtons[i]);        buttons[i].dwMask = static_cast<THUMBBUTTONMASK>(THB_ICON | THB_FLAGS);        wxString tooltip = m_thumbBarButtons[i]->GetTooltip();        if ( tooltip.empty() )            continue;        // Truncate the tooltip if its length longer than szTip(THUMBBUTTON)        // allowed length (260).        tooltip.Truncate(260);        wxStrlcpy(buttons[i].szTip, tooltip.t_str(), tooltip.length());        buttons[i].dwMask =            static_cast<THUMBBUTTONMASK>(buttons[i].dwMask | THB_TOOLTIP);    }    if ( !m_hasInitThumbnailToolbar )    {        hr = m_taskbarList->ThumbBarAddButtons(m_parent->GetHWND(),                                               MAX_BUTTON_COUNT,                                               buttons);        if ( FAILED(hr) )        {            wxLogApiError(wxT("ITaskbarList3::ThumbBarAddButtons"), hr);        }        m_hasInitThumbnailToolbar = true;    }    else    {        hr = m_taskbarList->ThumbBarUpdateButtons(m_parent->GetHWND(),                                                  MAX_BUTTON_COUNT,                                                  buttons);        if ( FAILED(hr) )        {            wxLogApiError(wxT("ITaskbarList3::ThumbBarUpdateButtons"), hr);        }    }    return SUCCEEDED(hr);}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:54,


示例3: HRESULT

bool wxTextEntry::AutoCompleteFileNames(){#ifdef HAS_AUTOCOMPLETE    typedef HRESULT (WINAPI *SHAutoComplete_t)(HWND, DWORD);    static SHAutoComplete_t s_pfnSHAutoComplete = (SHAutoComplete_t)-1;    static wxDynamicLibrary s_dllShlwapi;    if ( s_pfnSHAutoComplete == (SHAutoComplete_t)-1 )    {        if ( !s_dllShlwapi.Load(wxT("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) )        {            s_pfnSHAutoComplete = NULL;        }        else        {            wxDL_INIT_FUNC(s_pfn, SHAutoComplete, s_dllShlwapi);        }    }    if ( !s_pfnSHAutoComplete )        return false;    HRESULT hr = (*s_pfnSHAutoComplete)(GetEditHwnd(), SHACF_FILESYS_ONLY);    if ( FAILED(hr) )    {        wxLogApiError(wxT("SHAutoComplete()"), hr);        return false;    }    return true;#else // !HAS_AUTOCOMPLETE    return false;#endif // HAS_AUTOCOMPLETE/!HAS_AUTOCOMPLETE}
开发者ID:DumaGit,项目名称:winsparkle,代码行数:33,


示例4: wxAssocQueryString

// Helper wrapping AssocQueryString() Win32 function: returns the value of the// given associated string for the specified extension (which may or not have// the leading period).//// Returns empty string if the association is not found.staticwxString wxAssocQueryString(ASSOCSTR assoc,                            wxString ext,                            const wxString& verb = wxString()){    typedef HRESULT (WINAPI *AssocQueryString_t)(ASSOCF, ASSOCSTR,                                                  LPCTSTR, LPCTSTR, LPTSTR,                                                  DWORD *);    static AssocQueryString_t s_pfnAssocQueryString = (AssocQueryString_t)-1;    static wxDynamicLibrary s_dllShlwapi;    if ( s_pfnAssocQueryString == (AssocQueryString_t)-1 )    {        if ( !s_dllShlwapi.Load(wxT("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) )            s_pfnAssocQueryString = NULL;        else            wxDL_INIT_FUNC_AW(s_pfn, AssocQueryString, s_dllShlwapi);    }    if ( !s_pfnAssocQueryString )        return wxString();    DWORD dwSize = MAX_PATH;    TCHAR bufOut[MAX_PATH] = { 0 };    if ( ext.empty() || ext[0] != '.' )        ext.Prepend('.');    HRESULT hr = s_pfnAssocQueryString                 (                    wxASSOCF_NOTRUNCATE,// Fail if buffer is too small.                    assoc,              // The association to retrieve.                    ext.t_str(),        // The extension to retrieve it for.                    verb.empty() ? NULL                                 : static_cast<const TCHAR*>(verb.t_str()),                    bufOut,             // The buffer for output value.                    &dwSize             // And its size                 );    // Do not use SUCCEEDED() here as S_FALSE could, in principle, be returned    // but would still be an error in this context.    if ( hr != S_OK )    {        // The only really expected error here is that no association is        // defined, anything else is not expected. The confusing thing is that        // different errors are returned for this expected error under        // different Windows versions: XP returns ERROR_FILE_NOT_FOUND while 7        // returns ERROR_NO_ASSOCIATION. Just check for both to be sure.        if ( hr != HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) &&                hr != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) )        {            wxLogApiError("AssocQueryString", hr);        }        return wxString();    }    return wxString(bufOut);}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:65,


示例5: wxGetLocalTimeMillis

wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds){    wxLongLong curtime = wxGetLocalTimeMillis();    curtime += milliseconds;    wxLongLong temp = curtime / 1000;    int sec = temp.GetLo();    temp *= 1000;    temp = curtime - temp;    int millis = temp.GetLo();    timespec tspec;    tspec.tv_sec = sec;    tspec.tv_nsec = millis * 1000L * 1000L;    int err = pthread_cond_timedwait( &m_cond, GetPMutex(), &tspec );    switch ( err )    {        case ETIMEDOUT:            return wxCOND_TIMEOUT;        case 0:            return wxCOND_NO_ERROR;        default:            wxLogApiError(_T("pthread_cond_timedwait()"), err);    }    return wxCOND_MISC_ERROR;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:30,


示例6: wxLogApiError

/* static */wxTaskBarButton* wxTaskBarButton::New(wxWindow* parent){    wxITaskbarList3* taskbarList = NULL;    HRESULT hr = CoCreateInstance                 (                    wxCLSID_TaskbarList,                    NULL,                    CLSCTX_INPROC_SERVER,                    wxIID_ITaskbarList3,                    reinterpret_cast<void **>(&taskbarList)                 );    if ( FAILED(hr) )    {        // Don't log this error, it may be normal when running under XP.        return NULL;    }    hr = taskbarList->HrInit();    if ( FAILED(hr) )    {        // This is however unexpected.        wxLogApiError(wxT("ITaskbarList3::Init"), hr);        taskbarList->Release();        return NULL;    }    return new wxTaskBarButtonImpl(taskbarList, parent);}
开发者ID:EEmmanuel7,项目名称:wxWidgets,代码行数:31,


示例7: switch

wxMutexError wxMutexInternal::HandleLockResult(int err){    // wxPrintf( "err %d/n", err );    switch ( err )    {        case EDEADLK:            // only error checking mutexes return this value and so it's an            // unexpected situation -- hence use assert, not wxLogDebug            wxFAIL_MSG( _T("mutex deadlock prevented") );            return wxMUTEX_DEAD_LOCK;        case EINVAL:            wxLogDebug(_T("pthread_mutex_[timed]lock(): mutex not initialized"));            break;        case ETIMEDOUT:            return wxMUTEX_TIMEOUT;        case 0:            if (m_type == wxMUTEX_DEFAULT)                m_owningThread = wxThread::GetCurrentId();            return wxMUTEX_NO_ERROR;        default:            wxLogApiError(_T("pthread_mutex_[timed]lock()"), err);    }    return wxMUTEX_MISC_ERROR;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:30,


示例8: pthread_mutex_trylock

wxMutexError wxMutexInternal::TryLock(){    int err = pthread_mutex_trylock(&m_mutex);    switch ( err )    {        case EBUSY:            // not an error: mutex is already locked, but we're prepared for            // this            return wxMUTEX_BUSY;        case EINVAL:            wxLogDebug(_T("pthread_mutex_trylock(): mutex not initialized."));            break;        case 0:            if (m_type == wxMUTEX_DEFAULT)                m_owningThread = wxThread::GetCurrentId();            return wxMUTEX_NO_ERROR;        default:            wxLogApiError(_T("pthread_mutex_trylock()"), err);    }    return wxMUTEX_MISC_ERROR;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:25,


示例9: OleIsCurrentClipboard

bool wxClipboard::Flush(){#if wxUSE_OLE_CLIPBOARD    if (m_lastDataObject)    {        // don't touch data set by other applications        HRESULT hr = OleIsCurrentClipboard(m_lastDataObject);        m_lastDataObject = NULL;        if (S_OK == hr)        {            hr = OleFlushClipboard();            if ( FAILED(hr) )            {                wxLogApiError(wxT("OleFlushClipboard"), hr);                return false;            }            return true;        }    }    return false;#else // !wxUSE_OLE_CLIPBOARD    return false;#endif // wxUSE_OLE_CLIPBOARD/!wxUSE_OLE_CLIPBOARD}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:25,


示例10: SetForegroundColour

void wxComboCtrl::OnThemeChange(){    // there doesn't seem to be any way to get the text colour using themes    // API: TMT_TEXTCOLOR doesn't work neither for EDIT nor COMBOBOX    SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));#if wxUSE_UXTHEME    wxUxThemeEngine * const theme = wxUxThemeEngine::GetIfActive();    if ( theme )    {        // NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista)        wxUxThemeHandle hTheme(this, L"EDIT");        COLORREF col;        HRESULT hr = theme->GetThemeColor                            (                                hTheme,                                EP_EDITTEXT,                                ETS_NORMAL,                                TMT_FILLCOLOR,                                &col                            );        if ( SUCCEEDED(hr) )        {            SetBackgroundColour(wxRGBToColour(col));            // skip the call below            return;        }        wxLogApiError(_T("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);    }#endif    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:35,


示例11: pthread_mutex_destroy

BOINC_Mutex::~BOINC_Mutex(){    if ( m_isOk )    {        int err = pthread_mutex_destroy( &m_mutex );        if ( err != 0 )        {            wxLogApiError( wxT("pthread_mutex_destroy()"), err );        }    }}
开发者ID:Rytiss,项目名称:native-boinc-for-android,代码行数:11,


示例12: pthread_cond_destroy

wxConditionInternal::~wxConditionInternal(){    if ( m_isOk )    {        int err = pthread_cond_destroy(&m_cond);        if ( err != 0 )        {            wxLogApiError(_T("pthread_cond_destroy()"), err);        }    }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:11,


示例13: pthread_mutex_destroy

wxMutexInternal::~wxMutexInternal(){    if ( m_isOk )    {        int err = pthread_mutex_destroy(&m_mutex);        if ( err != 0 )        {            wxLogApiError( wxT("pthread_mutex_destroy()"), err);        }    }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:11,


示例14: dc

wxSize wxDatePickerCtrl::DoGetBestSize() const{    wxClientDC dc(const_cast<wxDatePickerCtrl *>(this));    // we can't use FormatDate() here as the CRT doesn't always use the same    // format as the date picker control    wxString s;    for ( int len = 100; ; len *= 2 )    {        if ( ::GetDateFormat               (                    LOCALE_USER_DEFAULT,    // the control should use the same                    DATE_SHORTDATE,         // the format used by the control                    NULL,                   // use current date (we don't care)                    NULL,                   // no custom format                    wxStringBuffer(s, len), // output buffer                    len                     // and its length               ) )        {            // success            break;        }        const DWORD rc = ::GetLastError();        if ( rc != ERROR_INSUFFICIENT_BUFFER )        {            wxLogApiError(wxT("GetDateFormat"), rc);            // fall back on wxDateTime, what else to do?            s = wxDateTime::Today().FormatDate();            break;        }    }    // the best size for the control is bigger than just the string    // representation of todays date because the control must accommodate any    // date and while the widths of all digits are usually about the same, the    // width of the month string varies a lot, so try to account for it    s += wxT("WW");    int x, y;    dc.GetTextExtent(s, &x, &y);    // account for the drop-down arrow or spin arrows    x += wxSystemSettings::GetMetric(wxSYS_HSCROLL_ARROW_X);    // and for the checkbox if we have it    if ( HasFlag(wxDP_ALLOWNONE) )        x += 3*GetCharWidth();    wxSize best(x, EDIT_HEIGHT_FROM_CHAR_HEIGHT(y));    CacheBestSize(best);    return best;}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:54,


示例15: pthread_cond_broadcast

wxCondError wxConditionInternal::Broadcast(){    int err = pthread_cond_broadcast(&m_cond);    if ( err != 0 )    {        wxLogApiError(_T("pthread_cond_broadcast()"), err);        return wxCOND_MISC_ERROR;    }    return wxCOND_NO_ERROR;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:12,


示例16: pthread_cond_wait

wxCondError wxConditionInternal::Wait(){    int err = pthread_cond_wait(&m_cond, GetPMutex());    if ( err != 0 )    {        wxLogApiError(_T("pthread_cond_wait()"), err);        return wxCOND_MISC_ERROR;    }    return wxCOND_NO_ERROR;}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:12,


示例17: m_mutex

wxConditionInternal::wxConditionInternal(wxMutex& mutex)                   : m_mutex(mutex){    int err = pthread_cond_init(&m_cond, NULL /* default attributes */);    m_isOk = err == 0;    if ( !m_isOk )    {        wxLogApiError(_T("pthread_cond_init()"), err);    }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:12,


示例18: wxCHECK_MSG

bool wxSafeArrayBase::Unlock(){    wxCHECK_MSG( m_array, false, wxS("Uninitialized safe array") );    HRESULT hr = SafeArrayUnlock(m_array);    if ( FAILED(hr) )    {        wxLogApiError(wxS("SafeArrayUnlock()"), hr);        return false;    }    return true;}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:12,


示例19: Unlock

void wxSafeArrayBase::Destroy(){    if ( m_array )    {        Unlock();        HRESULT hr = SafeArrayDestroy(m_array);        if ( FAILED(hr) )        {            wxLogApiError(wxS("SafeArrayDestroy()"), hr);        }        m_array = NULL;    }}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:13,


示例20: MSWGetSupportedFormat

// copy the data from the data source to the target data objectbool wxDropTarget::GetData(){    wxDataFormat format = MSWGetSupportedFormat(m_pIDataSource);    if ( format == wxDF_INVALID ) {        // this is strange because IsAcceptedData() succeeded previously!        wxFAIL_MSG(wxT("strange - did supported formats list change?"));        return false;    }    STGMEDIUM stm;    FORMATETC fmtMemory;    fmtMemory.cfFormat  = format;    fmtMemory.ptd       = NULL;    fmtMemory.dwAspect  = DVASPECT_CONTENT;    fmtMemory.lindex    = -1;    fmtMemory.tymed     = TYMED_HGLOBAL;  // TODO to add other media    bool rc = false;    HRESULT hr = m_pIDataSource->GetData(&fmtMemory, &stm);    if ( SUCCEEDED(hr) ) {        IDataObject *dataObject = m_dataObject->GetInterface();        hr = dataObject->SetData(&fmtMemory, &stm, TRUE);        if ( SUCCEEDED(hr) ) {            rc = true;        }        else {            wxLogApiError(wxT("IDataObject::SetData()"), hr);        }    }    else {        wxLogApiError(wxT("IDataObject::GetData()"), hr);    }    return rc;}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:39,


示例21: defined

bool wxDropTarget::Register(WXHWND hwnd){    // FIXME    // RegisterDragDrop not available on Windows CE >= 400?    // Or maybe we can dynamically load them from ceshell.dll    // or similar.#if defined(__WXWINCE__) && _WIN32_WCE >= 400    wxUnusedVar(hwnd);    return false;#else    HRESULT hr;    // May exist in later WinCE versions#ifndef __WXWINCE__    hr = ::CoLockObjectExternal(m_pIDropTarget, TRUE, FALSE);    if ( FAILED(hr) ) {        wxLogApiError(wxT("CoLockObjectExternal"), hr);        return false;    }#endif    hr = ::RegisterDragDrop((HWND) hwnd, m_pIDropTarget);    if ( FAILED(hr) ) {    // May exist in later WinCE versions#ifndef __WXWINCE__        ::CoLockObjectExternal(m_pIDropTarget, FALSE, FALSE);#endif        wxLogApiError(wxT("RegisterDragDrop"), hr);        return false;    }    // we will need the window handle for coords transformation later    m_pIDropTarget->SetHwnd((HWND)hwnd);    return true;#endif}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:37,


示例22: WXUNUSED

const void *wxDataObject::GetSizeFromBuffer(const void *buffer,                                            size_t *size,                                            const wxDataFormat& WXUNUSED(format)){    // hack: the third parameter is declared non-const in Wine's headers so    // cast away the const    const size_t realsz = ::HeapSize(::GetProcessHeap(), 0,                                     const_cast<void*>(buffer));    if ( realsz == (size_t)-1 )    {        // note that HeapSize() does not set last error        wxLogApiError(wxT("HeapSize"), 0);        return NULL;    }    *size = realsz;    return buffer;}
开发者ID:hazeeq090576,项目名称:wxWidgets,代码行数:19,


示例23: OleIsCurrentClipboard

void wxClipboard::Clear(){#if wxUSE_OLE_CLIPBOARD    if (m_lastDataObject)    {        // don't touch data set by other applications        HRESULT hr = OleIsCurrentClipboard(m_lastDataObject);        if (S_OK == hr)        {            hr = OleSetClipboard(NULL);            if ( FAILED(hr) )            {                wxLogApiError(wxT("OleSetClipboard(NULL)"), hr);            }        }        m_lastDataObject = NULL;    }#endif // wxUSE_OLE_CLIPBOARD}
开发者ID:252525fb,项目名称:rpcs3,代码行数:19,


示例24: wxEnableFileNameAutoComplete

extern bool wxEnableFileNameAutoComplete(HWND hwnd){#if wxUSE_DYNLIB_CLASS    typedef HRESULT (WINAPI *SHAutoComplete_t)(HWND, DWORD);    static SHAutoComplete_t s_pfnSHAutoComplete = NULL;    static bool s_initialized = false;    if ( !s_initialized )    {        s_initialized = true;        wxLogNull nolog;        wxDynamicLibrary dll(wxT("shlwapi.dll"));        if ( dll.IsLoaded() )        {            s_pfnSHAutoComplete =                (SHAutoComplete_t)dll.GetSymbol(wxT("SHAutoComplete"));            if ( s_pfnSHAutoComplete )            {                // won't be unloaded until the process termination, no big deal                dll.Detach();            }        }    }    if ( !s_pfnSHAutoComplete )        return false;    HRESULT hr = s_pfnSHAutoComplete(hwnd, 0x10 /* SHACF_FILESYS_ONLY */);    if ( FAILED(hr) )    {        wxLogApiError(wxT("SHAutoComplete"), hr);        return false;    }    return true;#else    wxUnusedVar(hwnd);    return false;#endif // wxUSE_DYNLIB_CLASS/!wxUSE_DYNLIB_CLASS}
开发者ID:JessicaWhite17,项目名称:wxWidgets,代码行数:42,


示例25: wxCHECK_MSG

// Name    : DoDragDrop// Purpose : start drag and drop operation// Returns : wxDragResult - the code of performed operation// Params  : [in] int flags: specifies if moving is allowe (or only copying)// Notes   : you must call SetData() before if you had used def ctorwxDragResult wxDropSource::DoDragDrop(int flags){  wxCHECK_MSG( m_data != NULL, wxDragNone, wxT("No data in wxDropSource!") );  DWORD dwEffect;  HRESULT hr = ::DoDragDrop(m_data->GetInterface(),                            m_pIDropSource,                            (flags & wxDrag_AllowMove)                                ? DROPEFFECT_COPY | DROPEFFECT_MOVE                                : DROPEFFECT_COPY,                            &dwEffect);  if ( hr == DRAGDROP_S_CANCEL ) {    return wxDragCancel;  }  else if ( hr == DRAGDROP_S_DROP ) {    if ( dwEffect & DROPEFFECT_COPY ) {      return wxDragCopy;    }    else if ( dwEffect & DROPEFFECT_MOVE ) {      // consistency check: normally, we shouldn't get "move" at all      // here if we don't allow it, but in practice it does happen quite often      return (flags & wxDrag_AllowMove) ? wxDragMove : wxDragCopy;    }    else {      // not copy or move      return wxDragNone;    }  }  else {    if ( FAILED(hr) ) {      wxLogApiError(wxT("DoDragDrop"), hr);      wxLogError(wxT("Drag & drop operation failed."));    }    else {      wxLogDebug(wxT("Unexpected success return code %08lx from DoDragDrop."),                 hr);    }    return wxDragError;  }}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:47,


示例26: wxAssocQueryString

// Helper wrapping AssocQueryString() Win32 function: returns the value of the// given associated string for the specified extension (which may or not have// the leading period).//// Returns empty string if the association is not found.staticwxString wxAssocQueryString(ASSOCSTR assoc,                            wxString ext,                            const wxString& verb = wxString()){    DWORD dwSize = MAX_PATH;    TCHAR bufOut[MAX_PATH] = { 0 };    if ( ext.empty() || ext[0] != '.' )        ext.Prepend('.');    HRESULT hr = ::AssocQueryString                 (                    wxASSOCF_NOTRUNCATE,// Fail if buffer is too small.                    assoc,              // The association to retrieve.                    ext.t_str(),        // The extension to retrieve it for.                    verb.empty() ? NULL                                 : static_cast<const TCHAR*>(verb.t_str()),                    bufOut,             // The buffer for output value.                    &dwSize             // And its size                 );    // Do not use SUCCEEDED() here as S_FALSE could, in principle, be returned    // but would still be an error in this context.    if ( hr != S_OK )    {        // The only really expected error here is that no association is        // defined, anything else is not expected. The confusing thing is that        // different errors are returned for this expected error under        // different Windows versions: XP returns ERROR_FILE_NOT_FOUND while 7        // returns ERROR_NO_ASSOCIATION. Just check for both to be sure.        if ( hr != HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) &&                hr != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) )        {            wxLogApiError("AssocQueryString", hr);        }        return wxString();    }    return wxString(bufOut);}
开发者ID:MediaArea,项目名称:wxWidgets,代码行数:47,



注:本文中的wxLogApiError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ wxLogDebug函数代码示例
C++ wxLaunchDefaultBrowser函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。