I have an assembly, written in C++\CLI, which uses some of enumerations, provided by .Net. It has such kind of properties:
property System::ServiceProcess::ServiceControllerStatus ^ Status
{
ServiceControllerStatus ^ get()
{
return (ServiceControllerStatus)_status->dwCurrentState;
}
}
it works fine, but when i use this assembly from my C# code, type of this property is
System.Enum
and i have to make type-cast
if ((ServiceControllerStatus)currentService.Status == ServiceControllerStatus.Running)
//do smth
The question is simple: why is it so, and how to fix it ?