PPAPI
- Download the Native Client SDK
- 创建一个vs2013工程:
- 新建一个Win32项目,类型选DLL
- 去掉预编译头文件stdafx.h和stdafx.cpp
- 在项目属性–>配置属性–>C/C++–>预编译头,把预编译头选项的值设置为不使用预编译头。
- 将一下代码粘贴到项目中。
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/var.h"
/// The Instance class. One of these exists for each instance of your NaCl
/// module on the web page. The browser will ask the Module object to create
/// a new Instance for each occurrence of the <embed> tag that has these
/// attributes:
/// src="hello_tutorial.nmf"
/// type="application/x-pnacl"
/// To communicate with the browser, you must override HandleMessage() to
/// receive messages from the browser, and use PostMessage() to send messages
/// back to the browser. Note that this interface is asynchronous.
class HelloTutorialInstance : public pp::Instance {
public:
/// The constructor creates the plugin-side instance.
/// @param[in] instance the handle to the browser-side plugin instance.
explicit HelloTutorialInstance(PP_Instance instance) : pp::Instance(instance