CLI VC++

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
Try to use as value class
1
2
com::myApp::MyObject myObject;
myObject.doSomething();
Topic archived. No new replies allowed.