why winuser.h getting error when using on CLR Class Library?


0
down vote
favorite
i try to create CLR Class library like this

#include "Stdafx.h"
#include "Image.h"
#include <msclr\marshal_cppstd.h>

namespace Vas
{
/// <summary>
/// Initializes a new instance of the <see cref="Image"/> class.
/// </summary>
Image::Image(int width, int height)
{
_mat = new cv::Mat(height, width, CV_8UC4);
}

///
Image::Image(System::String^ path)
{
std::string str = msclr::interop::marshal_as<std::string>(path);
_mat = new cv::Mat();
(*_mat) = cv::imread(str);
}

/// <summary>
/// Finalizes an instance of the <see cref="Image"/> class.
/// </summary>
Image::~Image()
{
if (_isDisposed)
return;

this->!Image();
_isDisposed = true;
}

Image::!Image()
{
delete _mat;
}

/// <summary>
/// Sets the specified data.
/// </summary>
/// <param name="data">The data.</param>
void Image::Set(array<unsigned char>^ data)
{
pin_ptr<unsigned char> ptr = &data[0];
unsigned char* src = ptr;
int size = _mat->rows * _mat->step;
memcpy_s(_mat->data, size, src, size);
}

///
void Image::Save(System::String^ path)
{
std::string str = msclr::interop::marshal_as<std::string>(path);
cv::imwrite(str, *_mat);
}
}
when i build this code, winuser.h is error like this:

error C2059: syntax error : ')' error C2059: syntax error : ')'

error C2059: syntax error : ')'

error C2059: syntax error : ')'

error C2143: syntax error : missing ';' before '__stdcall'

error C2143: syntax error : missing ';' before '__stdcall'

error C2146: syntax error : missing ')' before identifier 'hDesktop'

error C2146: syntax error : missing ')' before identifier 'hDesktop'

error C2146: syntax error : missing ')' before identifier 'hDesktop'

error C2146: syntax error : missing ')' before identifier 'hDesktop'

error C2146: syntax error : missing ';' before identifier 'hdesk'

error C2377: 'HDESK' : redefinition; typedef cannot be overloaded with any other symbol error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'

error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'

error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'

error C2440: 'initializing' : cannot convert from 'HDESK' to 'BOOL'
i try to found winuser.h or windows.h and i want to remove from my file, but i cannot foud it.

can come one tell me, why the error is come? and how to solve it? i'm already search on google and still cannot found the answer
Topic archived. No new replies allowed.