CLI VC++
Jun 28, 2018 at 5:47am UTC
After importing a CLI Dll created by C#, I try to new an Object in C++.
com::myApp::MyObject ^myObject = gcnew com::myApp::MyObject();
But I get the error
'^' cannot use this indirection on type 'com::myApp::Response'
I did not call the method that returns the Response Object. What should I do to make the gcnew and later method calls that actually return the Response Object work?
The C# library code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
namespace com.myApp
{
public interface IMyObject{
void doSomething();
}
public class MyObject{
public void doSomething(){
//do something
}
public Response getResponse(){
//return do stuff and return Response
}
}
public interface IResponse{
}
public class Response{
}
}
Last edited on Jun 28, 2018 at 5:48am UTC
Jun 28, 2018 at 7:05am UTC
Try to use as value class
1 2
com::myApp::MyObject myObject;
myObject.doSomething();
Topic archived. No new replies allowed.