Colin... All I can say is that MSIL understands static (class) methods and
variables so that you can certainly declare and use static member methods and
variables in a purely managed language as C#. C# does not support static
local variables. I don't (yet) have any C++/cli code for this so this is C#:
class TestStatic
{
// static stuff
private static int uniqueID= 0;
private static int GetUniqueID()
{
lock(typeof(Tes tStatic))
{
return uniqueID++; // returns zero at start
}
}
// member stuff
private int identity;
public TestStatic()
{
this.identity= TestStatic.GetU niqueID();
}
public int Identity
{
get
{
return identity;
}
}
}
"Colin Desmond" wrote:
I have an MFC Extension DLL that I have flicked the /clr switch on and made a
few other tweaks so it compiles and runs in a managed MFC applicaiton.
The DLL contains a number of classes which contain static member variables
and static methods. Are these permitted in a managed DLL?
Thanks
Colin