新手chrome插件开发人员需要帮助开始使用NPAPI

Newbie chrome-plugin developer needs help getting started with NPAPI

本文关键字:开始 帮助 NPAPI 插件 chrome 开发 新手      更新时间:2023-10-16

虽然在我试图编译以下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 settingsdell customerdesktopdlljsmethods.cpp(92) : error C2039: 'UTF8length' : is not a member of '_NPString'
        c:program filesmicrosoft visual studio 9.0vcincludepluginnpruntime.h(85) : see declaration of '_NPString'
c:documents and settingsdell customerdesktopdlljsmethods.cpp(101) : error C2039: 'UTF8characters' : is not a member of '_NPString'
        c:program filesmicrosoft visual studio 9.0vcincludepluginnpruntime.h(85) : see declaration of '_NPString'

等等……

除了这两个错误,一切看起来都很好,它不要求丢失的包括或任何东西。任何帮助,感谢!

除非我在最新SDK上弄错了,否则_NPString结构体被定义为…

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

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