【发布时间】:2020-07-15 09:45:08
【问题描述】:
那里。我是 CEFbrowser 的新手。 我正在开发 My CefBrowser 的下载模型。 我写了一些代码,但编译时出错。
class CefClient : public virtual CefBase {
public:
///
// Return the handler for download events. If no handler is returned downloads
// will not be allowed.
///
/*--cef()--*/
virtual CefRefPtr<CefDownloadHandler> GetDownloadHandler(){
return this;
}
但是 VS2015 说 C2440:
"return":cannot convert from 'CefClient *const' to 'CefRefPtr<CefDownloadHandler>'
我是新来的。当我将return this 更改为return null 时,它会运行,但无法下载。
我能做些什么来解决这个问题?
谢谢!
【问题讨论】:
-
看起来你的
CefClient必须继承自CefDownloadHandler,即class CefClient: public virtual CefBase, public CefDownloadHandler:stackoverflow.com/q/57198461/260313 -
好的,我试试这个。谢谢!
-
谢谢!这真的有效。我的问题已经解决了。
-
emm,如果你回答这个问题会更好,我会接受答案。
-
我很高兴它有帮助。好的,我会的!
标签: c++ visual-studio-2015 chromium-embedded