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

发布于 2024-12-12 18:42:36 字数 1166 浏览 2 评论 0原文

尽管在我尝试编译以下 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'

等等...

除了这两个错误之外,这一切看起来都很花花公子,它不要求丢失包含或任何东西。任何帮助表示赞赏!

Although only having done a very little in C++ before I'm trying to compile the following chrome plugin so that I can see how it works and use that as a starting point to develop something similar: http://code.google.com/p/minimizetotray/source/browse/trunk/?r=17#trunk%2FDLL

So far I have taken the following steps: downloaded the source, opened it in MS Visual Studio Pro 2008, and obtained a few of SDKs and headerfiles it was asking for including the latest version of the NPAPI headers: http://npapi-sdk.googlecode.com/svn/trunk/headers/

Now I get the following errors when I try to compile and have no idea how to sort this.

    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'

Etc...

Apart from those two errors it all seems dandy, its not asking for missing includes or anything. Any help appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谈下烟灰 2024-12-19 18:42:36

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

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

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

Unless I'm mistaken on the latest SDK the _NPString struct is defined as...

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

And in your code you are calling UTF8length instead of UTF8Length (uppercase L).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文