20160531 VS2013編譯duilibv1.1,“找不到Riched20.lib”的問題

1、打開DuiLib工程的屬性頁,進入“鏈接器” - “輸入”選項界面。

2、刪除Debug/Release/UnicodeDebug/UnicodeRelease幾個配置中,“附加依賴項”中的“Riched20.lib”(如圖1)。 

這裏寫圖片描述/

3、打開UIRichEdit.cpp定位到如下源代碼:

// Create Text Services component
if(FAILED(CreateTextServices(NULL, this, &pUnk)))
goto err;

4、將該段代碼修改爲如下內容:

HINSTANCE richHandle = NULL;
typedef HRESULT  (_stdcall *_CTS)(
    IUnknown *punkOuter,
    ITextHost *pITextHost,
    IUnknown **ppUnk) ; 
_CTS CTS = NULL;
richHandle = LoadLibraryW(L"Riched20.dll");
if(richHandle == NULL)
exit(0);
else
{
CTS = (_CTS)GetProcAddress(richHandle, "CreateTextServices");
if(NULL == CTS)
    exit(0);
}
// Create Text Services component
if(FAILED(CTS(NULL, this, &pUnk)))
goto err;
FreeLibrary(richHandle);



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章