从具有结构指针的VB.NET调用C ++ DLL函数 [英] Calling a C++ DLL function from VB.NET having structure pointer
本文介绍了从具有结构指针的VB.NET调用C ++ DLL函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用DLLImport
从我的VB.NET项目中使用C ++ DLL.但是我还没有在VB.NET中处理指针的经验.
C ++函数调用&声明在下面.
Hi,
I am using C++ DLL from my VB.NET project using DLLImport
. But I have not experience of how to handle the pointer in VB.NET.
The C++ function call & declaration is a below.
EXTERNC T_PDU_ERROR PDUGetModuleIds(PDU_MODULE_ITEM **pModuleIdList)
where
typedef struct {
T_PDU_IT ItemType;
UNUM32 NumEntries;
PDU_MODULE_DATA *pModuleData;
} PDU_MODULE_ITEM;
typedef struct {
UNUM32 ModuleTypeId;
UNUM32 hMod;
CHAR8 *pVendorModuleName;
CHAR8 *pVendorAdditionalInfo;
T_PDU_STATUS ModuleStatus;
} PDU_MODULE_DATA;
请告诉我如何从VB.NET应用程序中使用C ++ DLL.
在此先感谢
Please tell me how to use the C++ DLL from my VB.NET application.
Thanks in advance
推荐答案
这可能会有所帮助:
http://edais.mvps.org/Tutorials/CDLL/CDLLch4.html [ ^ ]
This may help:
http://edais.mvps.org/Tutorials/CDLL/CDLLch4.html[^]
谢谢,但我需要如何与结构指针配合使用
Thanks ,but I need that how to use with Structure Pointer
看看 Pinvoke [ ^ ]网站.它没有针对您的特定情况的条目,但是您可以从其他示例中很容易地弄清楚您需要做什么.
Take a look at the Pinvoke[^] site. It does not have an entry for your specific case, but you can figure out what you need to do from the other samples quite easily.
这篇关于从具有结构指针的VB.NET调用C ++ DLL函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文