Tech Off Post

Single Post Permalink

View Thread: Writing a managed version of ICreateDevEnum
  • User profile image
    Sven Groot

    cosminb wrote:
    namespace InterfaceTest
    {

        public interface class Intf
        {
            void Read();
        };

        public ref class Class1
        {
            void Something(Intf i)
            {
            }
        };

    }

    The change is in red:

    namespace InterfaceTest
    {

        public interface class Intf
        {
            void Read();
        };

        public ref class Class1
        {
            void Something(Intf ^i)
            {
            }
        };

    }

    EDIT: Since the original interface takes a double pointer to the interface, you're probably going to need "void Something(Intf ^%i)" there to pass a tracking reference to the managed pointer.