如何在C++注册松鼠类
How to register a Squirrel class in C++
您好,我正在尝试在C++应用程序中使用Squirrel。出于这个原因,我想在C++注册一个松鼠类。
让我们以下面的类为例。
class Foo
{
constructor(value)
{
::print("constructor called");
this.testValue = value;
}
function saySomething()
{
::print("The value is: " + this.testValue);
}
testValue = 0;
}
任何人都可以告诉我如何在C++中绑定它吗?
我能够做到这一点,通过使用这段代码。
在我的示例中,它看起来像这样:
sqext::SQIClass testClass(L"Foo");
testClass.bind(0, L"testValue");
testClass.bind(1, L"saySomething");
sqext::SQIClassInstance test = testClass.New(4711);
test.call(1);
相关文章:
- 无法将结构注册为增强几何体3D点
- 如何使用AngelScript注册SFML Vector2运算符
- 在遍历处理程序的向量时注册和注销处理程序
- 有没有任务栏API可以立即应用注册表更改
- 使用QJsEngine在Qt中注册自定义类型
- 检查注册表项是否链接到(或副本)另一个注册表项
- 如何使用 TStyleManager::UnRegisterStyle() 取消注册样式
- WINAPI 注册应用程序重新启动时不清除打开的套接字
- SFML 碰撞永远不会在我的系统中注册
- 尝试从C++访问 UWP 的电子邮件邮件类会导致"REGDB_E_CLASSNOTREG类未注册"错误
- 用于创建/注册虚拟存储设备的 IOKit 驱动程序
- 如何添加预防措施以绕过未注册Microsoft.ACE.OLEDB.12.0?
- 进程外 EXE 的免注册 COM
- 如何注册Qt C++对象以在QML中使用它
- 在Qt中注册自定义元类型的别名类型
- 禁用地址共享注册表不起作用
- 如何从注册表项中提取配置单元和注册表名称
- C++库和自注册类:客户端应用程序中的工厂映射为空
- 注册表正在设置 1 个字符
- 如何在C++非托管/本机 DLL 中从注册免费 COM C# 托管 DLL 创建 COM 对象