Can I change the rotation mode to world mode in C++?

I want to attach in C++ and then change the rotation mode to World.