S
Scott W
it's been awhile since I've done any real C++ development, but I'm trying to
create a managed interface to some COM libraries that don't implement
IDispatch or come with type libraries, so that pretty much means C++.
I have a managed class, MainClass, and an unmanaged class EventSink, the
managed class needs to create an instance of EventSink and set
EventSink._owner = this;
the EventSink class needs to call methods on the _owner member.
I have the following which complies fine. if I change the gcroot declaration
to use the actual type of MainClass I get lots and lots of errors. How can
I resolve this?
MainClass.h
#include "EventSink.h"
[CLSCompliant(true)]
public ref class MainClass : public System::ComponentModel::Component {
//full implementation in header file
}
EventSink.h
#include <vcclr.h>
class EngineSink :
public CComObjectRoot,...
{
public:
// gcroot<MainClass^> _owner;
gcroot<System::Object^> _owner;
//full implementation in header file
}
create a managed interface to some COM libraries that don't implement
IDispatch or come with type libraries, so that pretty much means C++.
I have a managed class, MainClass, and an unmanaged class EventSink, the
managed class needs to create an instance of EventSink and set
EventSink._owner = this;
the EventSink class needs to call methods on the _owner member.
I have the following which complies fine. if I change the gcroot declaration
to use the actual type of MainClass I get lots and lots of errors. How can
I resolve this?
MainClass.h
#include "EventSink.h"
[CLSCompliant(true)]
public ref class MainClass : public System::ComponentModel::Component {
//full implementation in header file
}
EventSink.h
#include <vcclr.h>
class EngineSink :
public CComObjectRoot,...
{
public:
// gcroot<MainClass^> _owner;
gcroot<System::Object^> _owner;
//full implementation in header file
}