首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ZScript FileExecute to DLL

ZScript FileExecute to DLL
EN

Stack Overflow用户
提问于 2016-10-15 14:01:24
回答 1查看 785关注 0票数 0

在ZScript for ZBrush中,可以使用FileExecute调用DLL。

代码语言:javascript
复制
[FileExecute,"ZBRUSH_ZData\ZPlugs\WebZPlug.dll",HTTP_Browse,"http://www.zbrushcentral.com"]

DLL的入口点(C/C++函数)从ZScript接收参数和数据的签名是什么?对于ZScript和C++之间的数据结构,是否有任何无文档的论据?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-15 14:15:05

在恢复了一些部分回答了这个问题的文档之后:以下是完整的FileExecute签名:

代码语言:javascript
复制
[FileExecute, Filename, Function to call, Optional text input, Option numeric input, Optional memory block input, Optional memory block output]

您可以传递在MemBlock中创建的内存块“ZScript”:

代码语言:javascript
复制
[FileExecute, "DllName.dll", "FunctionName", "StringArgument", [MemGetSize, "MemBlock"], "MemBlock",]

下面是DLL中的一个C++函数,用于接收来自ZScript的调用和内存块:

代码语言:javascript
复制
#define DLLEXPORT __declspec(dllexport)

extern "C" int DLLEXPORT FunctionName(unsigned char* message, double number, void* memblock, void* memblock2)
{
    int mbSize = (int)number; // the second argument has to be a double

    // Read from the memory block via a strstream
    stdstrstream mbStream((char*)memblock, mbSize);

    // Read the first integer written into the memory block by the ZScript
    int val = 0;
    mbStream.read((char*)&val, 4);
}

extern "C"是使一个C++函数具有'C‘链接(编译器不会损坏名称),以便ZBrush C代码可以链接到它。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40059948

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档