M
mirek
Hi,
I've got problem building managed class library to wrap unmanaged code.
I created managed class library using standard patten:
#include "../Unmanaged/Class1.h" //Class1 unmanaged
namespace ManagedWrappers
{
public __gc MClass1
{
public:
MClass1() { m_pClass1 = new Class1(); };
~MClass1() { delete m_pClass1; };
private:
Class1* m_pClass1;
}
}
the result is ManagedWrappers.dll assembly.
Now I want to use ManagedWrappers in another project (also managed
library, let's say FooBar.dll) so I add reference to it in VS and start
using it only by managed wrappers.
But compiling this project fails:
error C3635: '::Class1': undefined native type used in
'ManagedWrappers::MClass1'; imported native types must be defined in the
importing source code did you forget to include a header file?
So do I have to include "../Unmanaged/Class1.h" in the FooBar classes?
What should I do to have ManagedWrappers assembly that will contain all
the wrapped classes and nothing will be required (besides reference) to
use it freely?
Any suggestions would be greatfully appreciated.
BTW I'd also like to know what does it do if in managed class library I
add reference to unmanaged library? Does it differ from specyfying this
library in "Additional dependency"?
Regards,
Mirek
I've got problem building managed class library to wrap unmanaged code.
I created managed class library using standard patten:
#include "../Unmanaged/Class1.h" //Class1 unmanaged
namespace ManagedWrappers
{
public __gc MClass1
{
public:
MClass1() { m_pClass1 = new Class1(); };
~MClass1() { delete m_pClass1; };
private:
Class1* m_pClass1;
}
}
the result is ManagedWrappers.dll assembly.
Now I want to use ManagedWrappers in another project (also managed
library, let's say FooBar.dll) so I add reference to it in VS and start
using it only by managed wrappers.
But compiling this project fails:
error C3635: '::Class1': undefined native type used in
'ManagedWrappers::MClass1'; imported native types must be defined in the
importing source code did you forget to include a header file?
So do I have to include "../Unmanaged/Class1.h" in the FooBar classes?
What should I do to have ManagedWrappers assembly that will contain all
the wrapped classes and nothing will be required (besides reference) to
use it freely?
Any suggestions would be greatfully appreciated.
BTW I'd also like to know what does it do if in managed class library I
add reference to unmanaged library? Does it differ from specyfying this
library in "Additional dependency"?
Regards,
Mirek