I've created C++ DLL project, this dll contains mostly native c++ code, but it have 1 mixed class written in C++ and using some .NET types. This class is declared in header file and have implementation in .cpp
I can use it from all *.cpp files, but when i try to declare reference to C++/CLI class in some c++ header file i got tons of errors about project doesnt support CLR(CLR support in project settings as /clr is set up), it looks like header files doesnt support links to managed classes.
This works from .CPP perfectly but fails with errors when used from .H
#include "NativeBitmap.h"
using namespace Native;
NativeBitmap.H:
#pragma once
namespace Native
{
using namespace System;
using namespace System::Drawing;
using namespace System::Collections::Generic;
using namespace System::Runtime::InteropServices;
public ref class NativeBitmap
{
}
}
NativeBitmap.CPP:
#include "stdafx.h"
#include "NativeBitmap.h"
using Native::NativeBitmap;
using namespace System;
using namespace System::Drawing;
using namespace System::Collections::Generic;
using namespace System::Runtime::InteropServices;
void NativeBitmap::Create(...)
{
...
}
and so on ...