VS2013编译duilibv1.1,“找不到Riched20.lib”的问题

打开DuiLib工程的属性页,进入“链接器” - “输入”选项界面。

删除Debug/Release/UnicodeDebug/UnicodeRelease几个配置中,“附加依赖项”中的“Riched20.lib”如图1:
图1

打开UIRichEdit.cpp定位到如下源代码:

找到如下代码段:

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

修改为:

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);

然后再编译,就没有“找不到Riched20.lob”的问题了。

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐