What is the difference between #pragma managed(push, off) and #pragma managed(push, on)?
When we need to use #pragma managed(push, on) instead of #pragma managed(push, off)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s obvious – “off” turns managed code off, “on” – turns it on.
We use
#pragma managed(push, on)when we need to save state and turn it on.In common case, in header file, we don’t know if managed code enabled, so we enable it: