新手chrome插件开发者需要NPAPI入门帮助 虽然在尝试编译下面的Chrome插件之前只做了很少的C++,这样我就可以看到它是如何工作的,并以此为起点开发类似的:
到目前为止,我已经采取了以下步骤:下载源代码,在MS Visual Studio Pro 2008中打开它,并获得了它要求的一些SDK和HeaderFile,包括最新版本的NPAPI头文件: 现在,当我试图编译时,出现了以下错误,但不知道如何对其进行排序新手chrome插件开发者需要NPAPI入门帮助 虽然在尝试编译下面的Chrome插件之前只做了很少的C++,这样我就可以看到它是如何工作的,并以此为起点开发类似的:,c++,visual-studio-2008,google-chrome-extension,compiler-errors,npapi,C++,Visual Studio 2008,Google Chrome Extension,Compiler Errors,Npapi,到目前为止,我已经采取了以下步骤:下载源代码,在MS Visual Studio Pro 2008中打开它,并获得了它要求的一些SDK和HeaderFile,包括最新版本的NPAPI头文件: 现在,当我试图编译时,出现了以下错误,但不知道如何对其进行排序 Compiling... JSMethods.cpp c:\documents and settings\dell customer\desktop\dll\jsmethods.cpp(92) : error C2039: 'UTF8l
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上弄错了,\u NPString结构被定义为
typedef char NPUTF8;
typedef struct _NPString {
const NPUTF8 *UTF8Characters;
uint32_t UTF8Length;
} NPString;
在你的代码中,你调用的是UTF8length,而不是UTF8length(大写L)。你使用的是什么版本的XulRunner SDK?你可能还想看看它,而不是手工操作——这要容易得多,特别是对于新手(但许多高级插件开发人员也使用它)来说,哇哦!如果我真的尝试过的话,我想我可以自己解决这个问题,做得好,我匿名发布:-P不知道为什么我制作的DLL是分布式DLL的三倍,但它似乎确实有效,谢谢你的帮助!可能您在设置“在静态库中使用MFC”中有。。。从NPAPI开始的一个好地方是,这意味着代码还需要更改为使用UTF8Characters而不是UTF8Characters:std::string ret=NPVARIANT_to_string(locationValue);