将结构作为dll函数参数传递 [英] Passing structure as dll function argument

查看:102
本文介绍了将结构作为dll函数参数传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个名为POUDetails的结构,该结构具有以下成员.

Hello All,

I have structure called POUDetails which has the following members.

{
typedef struct POUDetails
{
 CStringArray POUName;
 int Version;
 Cstring View;
.
.
}
.
.
.

POUDetails First;        ///instance of structure.

}



我想将此结构作为dll函数的函数参数传递,
DLL功能:



I want to pass this structure as function argument of dll function,
Dll function:

void WINAPI FillPOU(POUDetails mystruct,int index)
{
}


DLL函数调用


Dll function call

FillPOU(First,1)



这给了我
的错误 cannot convert POUDetails to POUDetails.

所以下一次我要使用类似
的指针



This gives me error of
cannot convert POUDetails to POUDetails.

so next time I go with pointers like

void WINAPI FillPOU(POUDetails* mystruct,int index)
{
}



和称为
的函数



and function called

FillPOU(&First,1);



即使那样也会给我
的错误 Cannot convert POUDetails* _w64 to POUDetails*

谁能给我一些线索.



even then it gives me error of
Cannot convert POUDetails* _w64 to POUDetails*

Can anybody give me some clue about this.

推荐答案

我不认为您可以混合使用平台.尝试将应用程序和dll都更改为32位或64位,然后查看是否可以清除.
I don''t think you can mix platforms. Try changing both the app and the dll to either 32-bit or 64-bit and see if it clears up.


这篇关于将结构作为dll函数参数传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆