I got stuck with a "ref" keyword which is applied to the class in .cpp file. I want to access a method which is marked as __clrcall. Can u tell me what ref keyword used for in visual c++ code?
+2
A:
From MSDN:
A ref class or ref struct can inherit from zero or more managed interfaces and zero or one ref types. A value class or value struct can only inherit from zero or more managed interfaces.
Aamir
2009-03-27 12:42:04
Still confused please elaborate
Nipun
2009-03-27 12:51:32
+1
A:
The "short short" version is that a "ref class" is a managed class. You can't have member variables of a managed type (.NET Library objects, like StringBuilder or TCPListener) in a class that is not declared "ref" -- that is, unmanaged classes cannot contain managed objects.
Coderer
2009-03-27 13:07:08
A:
"ref" keyword used on class says that this class is a managed class and c# program can access it.This class is not a normal C++ class.
Nipun
2009-03-28 07:44:40