Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/139.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何为IE编译和构建这个BHO?_C++_Winapi_Compiler Errors - Fatal编程技术网

C++ 如何为IE编译和构建这个BHO?

C++ 如何为IE编译和构建这个BHO?,c++,winapi,compiler-errors,C++,Winapi,Compiler Errors,当我编译时,会出现很多错误: error C2236: unexpected 'class' 'adpbho'. Did you forget a ';'? error C3381: 'adpbho' : assembly access specifiers are only available in code compiled with a /clr option ..\adpbho.cpp(15) : error C3861: 'MB1': identifier not found ..\

当我编译时,会出现很多错误:

error C2236: unexpected 'class' 'adpbho'. Did you forget a ';'?

error C3381: 'adpbho' : assembly access specifiers are only available in code compiled with a /clr option
..\adpbho.cpp(15) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(24) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(34) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(85) : error C3861: 'MB1': identifier not found
..\adpbho.cpp(95) : error C2014: preprocessor command must start as first nonwhite space
..\adpbho.cpp(96) : error C2039: 'MB1' : is not a member of 'adpbho'

嗯,假设你关闭了你的大脑,然后在网站上剪切并粘贴垃圾,第一个错误是,这不是一个有效的声明C++类的方法:

class BHO class adpbho : public IObjectWithSite, public IDispatch  {
有两个类语句。这是不允许的。可能应该是:

class adpbho : public IObjectWithSite, public IDispatch  {
代码的其余部分也非常可怕。你必须一行一行地去清理,或者找一个更好的样品

编辑:我看得越多,看到的错误就越多。我强烈建议您不要使用此代码,而是在某处找到更好的示例

<>这与BHO的IE插件和基本的C++ Win32编程无关,所以我会修改你的标签。