如何将VB结构的对象传递给VC ++ DLL结构?

时间:2015-03-30 13:01:35

标签: c++ vb.net oop

------------------------------------ VB Code --------- ---------------------------

Public Class Form1

    Public Structure Test_Structure
        Dim xyz As Integer
        Dim abc As System.String
    End Structure 

    Dim OBJ_Structure As New Test_Structure
    Dim OBJ_Dll As New Test_Dll

    Public Sub Temp()
        OBJ_Dll.Dll_Function(OBJ_Structure) 
    End Sub
End Class

-------------------------------- VC ++代码------------- -----------------------

Public ref Class Dll
{
    public ref struct Temp
    {
        int xyz;
        System::String^ abc;
    };

    int Dll_Function(Temp^ obj_Temp);
};

如上所示,我想将VB Structure(非托管)的对象传递给VC ++ Structure(托管)。但是我得到了类型转换的错误。应该解决这个问题。

0 个答案:

没有答案