Passing Structures from C++ to a VB .NET DLL

Joined
Feb 12, 2010
Messages
1
Reaction score
0
I'm having trouble getting the correct syntax for passing a structure from C++ to VB .NET.

I have a VB .Net DLL program with the following code:

Public Structure testParams
Public iFirst As Integer
Public iSecond As Integer
End Structure

Public Class clsKpdUI
Public Function ShowForm(ByVal Param1 As testParams) As Integer
' Code
End Function
End Class

I have C++ program with the following code:

struct testParams {
int iFirst;
int iSecond;
};

kpdUI::clsKpdUI myUI;
testParams tp;
tp.iFirst = 4;
tp.iSecond = 3;
myintR = myUI.ShowForm3(tp);

When I try to compile the C++ code, I get the following Error:
Error 1 error C2664: 'kpdUI::clsKpdUI::ShowForm' : cannot convert parameter 1 from 'testParams' to 'kpdUI::testParams' c:\test\Form1.h 133 TestKpdUIcpp

How do I correct this error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top