Click here to Skip to main content
14,299,900 members

Managed C++/CLI

 
AnswerRe: How to trace an unhandled exception in C++ using Visual Studio 2017 Pin
Richard MacCutchan31-Oct-18 23:55
protectorRichard MacCutchan31-Oct-18 23:55 
GeneralRe: How to trace an unhandled exception in C++ using Visual Studio 2017 Pin
AndreyAksenov7-Dec-18 2:38
memberAndreyAksenov7-Dec-18 2:38 
GeneralRe: How to trace an unhandled exception in C++ using Visual Studio 2017 Pin
Richard MacCutchan7-Dec-18 3:22
protectorRichard MacCutchan7-Dec-18 3:22 
AnswerRe: How to trace an unhandled exception in C++ using Visual Studio 2017 Pin
John Schroedl5-Nov-18 5:13
professionalJohn Schroedl5-Nov-18 5:13 
Questionmeaing of below code Pin
Member 139765087-Sep-18 22:01
memberMember 139765087-Sep-18 22:01 
AnswerRe: meaing of below code Pin
Richard MacCutchan7-Sep-18 22:32
protectorRichard MacCutchan7-Sep-18 22:32 
AnswerRe: meaing of below code Pin
Victor Nijegorodov8-Sep-18 1:07
memberVictor Nijegorodov8-Sep-18 1:07 
Questionc++ sms send dll Pin
Member 139765087-Sep-18 1:07
memberMember 139765087-Sep-18 1:07 
AnswerRe: c++ sms send dll Pin
Richard MacCutchan7-Sep-18 2:38
protectorRichard MacCutchan7-Sep-18 2:38 
AnswerRe: c++ sms send dll Pin
Victor Nijegorodov8-Sep-18 1:04
memberVictor Nijegorodov8-Sep-18 1:04 
AnswerRe: c++ sms send dll Pin
vidhya 360 com14-Oct-18 20:38
membervidhya 360 com14-Oct-18 20:38 
QuestionSharpen filter of bmp image Pin
Jakub Bartczak27-Aug-18 21:21
memberJakub Bartczak27-Aug-18 21:21 
AnswerRe: Sharpen filter of bmp image Pin
Jochen Arndt27-Aug-18 22:56
mveJochen Arndt27-Aug-18 22:56 
Questionplease explain this lines of code Pin
Hiếu Ngô2-Aug-18 18:18
memberHiếu Ngô2-Aug-18 18:18 
AnswerRe: please explain this lines of code Pin
Richard MacCutchan2-Aug-18 21:47
protectorRichard MacCutchan2-Aug-18 21:47 
AnswerRe: please explain this lines of code Pin
Jochen Arndt2-Aug-18 22:29
mveJochen Arndt2-Aug-18 22:29 
NewsC++/CLI support comes to ReSharper C++ Pin
John Schroedl23-Jul-18 6:22
professionalJohn Schroedl23-Jul-18 6:22 
QuestionTo find the angle of turn in a car racing game in C++/SFML Pin
Tarun Jha21-Jul-18 23:39
memberTarun Jha21-Jul-18 23:39 
AnswerRe: To find the angle of turn in a car racing game in C++/SFML Pin
John Schroedl23-Jul-18 6:41
professionalJohn Schroedl23-Jul-18 6:41 
GeneralRe: To find the angle of turn in a car racing game in C++/SFML Pin
Tarun Jha25-Jul-18 7:36
memberTarun Jha25-Jul-18 7:36 
QuestionSmall RAII-like cleanup class in C++/CLI Pin
John Schroedl15-Jun-18 9:08
professionalJohn Schroedl15-Jun-18 9:08 
In native code, we often use helper classes to save a reference to a member, set its value and reset it in destruction. standard stuff.

Unfortunately, I haven't found a good way in a ref class to do the same and I'm hoping for some tips here.

Since I cannot hold a reference to a member of a managed object as a member of another object, I tried using a tracking reference. Unfortunately, that results in an similar error:

error C3160: 'System::Boolean ^%': a data member of a managed class cannot have this type
note: an interior reference can never be allocated on the gc heap


An example I hope to get working...

ref class Foo { bool m_guard; . . . }

ref class PushBool sealed {
  bool ^% m_tref;
public:
   PushBool(bool ^% b, bool newVal) : m_tref(b), m_oldval(b) { b = newVal; }
   ~PushBool() { m_tref = m_oldval; }
};

usage...

void Foo::work() {
   if (m_guard) return;
   PushBool no_reentry(m_guard, true);
   ...
   // Resets m_flag to original value here.
}


Do any of the C++/CLI devs here have advice on handling this? I can probably concoct a way to make it work but was hoping for a reusable utility class.

John
QuestionInformation Edit Source code for c++ Pin
Member 1165875229-May-18 19:48
memberMember 1165875229-May-18 19:48 
AnswerRe: Information Edit Source code for c++ Pin
Richard MacCutchan29-May-18 21:05
protectorRichard MacCutchan29-May-18 21:05 
AnswerRe: Information Edit Source code for c++ Pin
Jochen Arndt30-May-18 2:55
mveJochen Arndt30-May-18 2:55 
QuestionError On a Project I'm Working On. (Sorry If Not descriptive enough, 1st time) Pin
CyberFaggot9-May-18 15:53
memberCyberFaggot9-May-18 15:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.