I’m having trouble calling a C++ constructor in my Visual Basic code. The DLL has been imported correctly but this line in particular is giving me trouble:
Dim myobj As New MyObject("param1", "param2", "param3")
And the corresponding C++ constructor:
MyObject::MyObject(System::String ^ p1, System::String ^ p2, System::String ^ p3)
Any suggestions?
You can’t. It’s simply not supported this way.
The easiest way of doing it is to just convert the constructor into a function (eg
Initialize()).