67,513
社区成员
发帖
与我相关
我的任务
分享
struct ABC{int size;
byte* keyHandle}
;int fun(char* instr, int inlen, char* outstr, int& outlen);
int fun(String instr,int inlen, ByteByReference outstr, IntByReference outlen);
???struct BXL{int size;char* buf};
DLL的接口函数为
void fun(BXL *bxl);
在这个接口中,要根据结构体中的size为buf赋值,buf的内存空间在接口外申请;接口执行完毕后,返回给我这个结构体
我java结构体代码是这样写的
public class BXL extends Strutcture{
int size;
byte[] buf;
public static class ByReference extends BXL implements Structure.ByReference{};
public static class ByValue extends BXL implements Structure.ByValue{};
};
DLL中函数fun的接口写法为
void fun(BXL.ByReference bxl);
调用DLL接口函数时,我将结构体初始化
BXL.ByReference bxl = new BXL.ByReference();
bxl.size = 4;
bxl.buf = new byte[4];
然后将结构体传入接口中,运行完毕后,结构体的buf中没有值,不知道应该怎么才能实现这个功能