member access operator '.' illegal with managed pointers
The dot operator cannot be used with managed pointers. The member-selection operator must be used.
The following sample generates C3811:
#using <mscorlib.dll> class A { public: void fa(){ } }; __gc class B { public: void fb(){ } }; void main() { A* a = new A; B* b = new B; (*a).fa(); // ok, standard C++ (*b).fb(); // C3811, not allowed with managed pointers a->fa(); // ok, stanard C++ b->fb(); // ok with managed pointers }