Hello, I am pretty new to C# (but I have used java)
I want to use my c# class in a c++ project, this means I will need to make a COM object, It seems reasonably easy I have been using this mainly as a template. My program was a c# dll, so I am converting it.
I have been using the c# getter and setters, for example:
public int Inlet
{
get
{
return this.inlet;
}
set
{
this.inlet = value;
}
}
but, this, as far as I can tell, isn't a methodor a variable, (it uses the variable inlet, but it is actually two functions "merged" into one)
I can't put it in my COM interface:
[Guid("1061ABA6-19E0-4ed2-A253-9C28D89771D7")]
public interface IGC7890Controller
{
//Getters and setters
public int Column;
public int Inlet;
//other methods
}
because they look like variables to the compiler and I get "error CS0525: Interfaces cannot contain fields"
Is there any way to not change all my getters and setters into specific GetFoo() and SetFoo(), am I being stupid and missing something?
Thanks