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

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

  2. 删除Debug/Release/UnicodeDebug/UnicodeRelease几个配置中,“附加依赖项”中的“Riched20.lib”(如图1)。
    VS2013编译duilibv1.1,“找不到Riched20.lib”的问题_第1张图片
    图1

  3. 打开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);

你可能感兴趣的:(duilib)