c++ - 新手Chrome插件开发人员需要NPAPI入门方面的帮助

尽管在尝试编译以下chrome插件之前仅在C++中做了一点点工作,以便我可以看到它的工作原理并将其用作开发类似内容的起点:http://code.google.com/p/minimizetotray/source/browse/trunk/?r=17#trunk%2FDLL

到目前为止,我已经采取了以下步骤:下载源代码,在MS Visual Studio Pro 2008中打开它,并获得了它所要求的一些SDK和头文件,包括最新版本的NPAPI头:http://npapi-sdk.googlecode.com/svn/trunk/headers/

现在,当我尝试编译并且不知道如何对其进行排序时,将收到以下错误。

    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'

等等...

除了这两个错误外,所有这些似乎都很花哨,它不要求缺少包含项或其他内容。任何帮助表示赞赏!

最佳答案

除非我在最新的SDK上出错,否则_NPString结构定义为...

typedef char NPUTF8;
typedef struct _NPString {
    const NPUTF8 *UTF8Characters;
    uint32_t UTF8Length;
} NPString;

在您的代码中,您正在调用UTF8length而不是UTF8Length(大写L)。

https://stackoverflow.com/questions/7931471/

相关文章:

java - 编译时出现一个或多个错误的NetBeans项目

objective-c - 尽管导入了正确的 header ,但使用自定义类的编译器错误

java - Java编译时错误: reached end of file while parsin

php - 使用PHP的exec()函数(或类似函数),如何显示终端错误输出?

compiler-construction - lex 使用来自 lex.yy.c 文件的 flex

compiler-errors - nant 构建文件使用 nant 0.86 而不是 0.91 a

asp.net - 加载共享类库时出错

java - 编译Java项目时出错

android - 在 Android 中初始化一个大的常量数据结构

objective-c - UIAlertView dismissWithClickedButton