I have an unmanged C++ class I have written in an unmanged dll. I have a managed dll that references the unmanaged dll. Can a class in the managed dll derive from the unmanaged class?
Using Visual Studio 2008
I have an unmanged C++ class I have written in an unmanged dll. I have a managed dll that references the unmanaged dll. Can a class in the managed dll derive from the unmanaged class?
Using Visual Studio 2008
You can't. Managed classes are garbage collected and created on CLR heap. Unmanaged classes are allocated in unmanaged heap. How could you be able to create an object whose data is partially in managed heap and its base data in unmanaged heap.
You should try other techniques, to wrap a managed container over the unmanaged thing or vice versa and derive from that, probably.
You can't yet. Herb Sutter wrote an extensive C++/CLI Design Rationale where he hints such things may indeed be possible one day. However, it seems that Microsoft has stopped further development of C++/CLI?
The best you can do is wrap you unmanaged class in a manager wrapper and then derive from that.