I have a .NET Library registered for COM Interop which I successfully use from VB6 code (so, it's propperly registered and this is not the issue).
What happens is that I'm trying to use this same library via C++ code (an MFC ActiveX Control) and I'm not even being able to instantiate the object (yes, it has a parameterless constructor).
Imagine that the namespace is Foo and the name of the class is Bar. How would I instantiate such object? I'm trying this:
On the .h file:
Foo::Bar *obj;
On the .cpp file, on the constructor of the ActiveX control:
obj = new Foo::Bar();
And I'm getting the following errors:
- «incomplete type is not allowed"»;
- «error C2027: use of undefined type 'Foo::Bar'».
So basically my question is: How does one use .NET COM Interop objects from C++ code?