虽然在我尝试编译以下chrome插件之前只在C ++中做了很少的事情,以便我可以看到它是如何工作的,并将其用作开发类似的东西的起点:http://code.google.com/p/minimizetotray/source/browse/trunk/?r=17#trunk%2FDLL
到目前为止,我已采取以下步骤:下载源代码,在MS Visual Studio Pro 2008中打开它,并获得了一些SDK和头文件,它要求包含最新版本的NPAPI头文件:{{3} }
现在我在尝试编译时遇到以下错误,并且不知道如何对此进行排序。
Compiling...
JSMethods.cpp
c:\documents and settings\dell customer\desktop\dll\jsmethods.cpp(92) : error C2039: 'UTF8length' : is not a member of '_NPString'
c:\program files\microsoft visual studio 9.0\vc\include\plugin\npruntime.h(85) : see declaration of '_NPString'
c:\documents and settings\dell customer\desktop\dll\jsmethods.cpp(101) : error C2039: 'UTF8characters' : is not a member of '_NPString'
c:\program files\microsoft visual studio 9.0\vc\include\plugin\npruntime.h(85) : see declaration of '_NPString'
等等...
除了这两个错误之外,这一切看起来都很花哨,它不会要求遗漏包含或任何东西。任何帮助表示赞赏!
答案 0 :(得分:0)
除非我对最新的SDK有误,否则_NPString结构被定义为......
typedef char NPUTF8;
typedef struct _NPString {
const NPUTF8 *UTF8Characters;
uint32_t UTF8Length;
} NPString;
在您的代码中,您调用UTF8length而不是UTF8Length(大写L)。