Click here to Skip to main content
15,887,683 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: SaveFileDialog and OpenFileDialog in C++/CLI Pin
Epi7-Apr-09 23:07
Epi7-Apr-09 23:07 
GeneralRe: SaveFileDialog and OpenFileDialog in C++/CLI Pin
Eslam Afifi7-Apr-09 23:14
Eslam Afifi7-Apr-09 23:14 
GeneralRe: SaveFileDialog and OpenFileDialog in C++/CLI Pin
Epi12-Apr-09 20:54
Epi12-Apr-09 20:54 
GeneralRe: SaveFileDialog and OpenFileDialog in C++/CLI Pin
Eslam Afifi13-Apr-09 4:18
Eslam Afifi13-Apr-09 4:18 
QuestionThreading Problem Pin
erfi1-Apr-09 0:55
erfi1-Apr-09 0:55 
AnswerRe: Threading Problem Pin
led mike1-Apr-09 4:47
led mike1-Apr-09 4:47 
AnswerRe: Threading Problem Pin
Mark Salsbery1-Apr-09 6:45
Mark Salsbery1-Apr-09 6:45 
QuestionReflection and MessageBox Pin
W Balboos, GHB31-Mar-09 3:19
W Balboos, GHB31-Mar-09 3:19 
Hi;

I'm finally digging into Reflection and thought, as an exercise, to create an instance of MessageBox and then to modify some of it's (private) properties, such as the font.

Using GetFields() to extract the FieldInfo, all I can get a few items out of it (static values which are, effectively, the return values). As for get Constructor: I get nothing. Creating an instance wants args (for the constructor) which I can't seem to get.

Testing on a very simple home-made method, I can read/write to public/protected/private fields, and the above listing methods (for fields, constructors) works fine.

Any comments and/or steering suggestions for my quest? (code snippets below)

Balboos

Reflection::Assembly ^a = Reflection::Assembly::GetAssembly(MessageBox::typeid);
// Gets all types/methods/whatever defined in the above assembly.
array<type^>^ typeArray = a->GetTypes(); // MessageBox is at index=1213

Type ^TypeToReflect = typeArray[1213];

Object ^n = TypeToReflect->InvokeMember("IDOK", BindingFlags::GetField | BindingFlags::Public | BindingFlags::NonPublic | BindingFlags::Instance | BindingFlags::Static, nullptr, TypeToReflect, nullptr );

// This returns a short list of items; mainly IDOK, IDCANCEL, etc.
array<system::reflection::fieldinfo xmlns:system="#unknown"> ^fields = TypeToReflect->GetFields(
        BindingFlags::Public | BindingFlags::NonPublic | BindingFlags::Instance | BindingFlags::Static);

// This returns an empty array
array<system::reflection::constructorinfo> ^Members = TypeToReflect->GetConstructors();

</system::reflection::constructorinfo></system::reflection::fieldinfo>


"The difference between genius and stupidity is that genius has its limits." - Albert Einstein

"How do you find out if you're unwanted if everyone you try to ask tells you to stop bothering them and just go away?" - Balboos HaGadol


"It's a sad state of affairs, indeed, when you start reading my tag lines for some sort of enlightenment. Sadder still, if that's where you need to find it." - Balboos HaGadol



AnswerRe: Reflection and MessageBox [modified] Pin
Luc Pattyn31-Mar-09 5:15
sitebuilderLuc Pattyn31-Mar-09 5:15 
GeneralRe: Reflection and MessageBox Pin
W Balboos, GHB31-Mar-09 6:43
W Balboos, GHB31-Mar-09 6:43 
QuestionResolving C++ dll's inside CLI Pin
BicycleTheif31-Mar-09 2:38
BicycleTheif31-Mar-09 2:38 
AnswerRe: Resolving C++ dll's inside CLI Pin
Mark Salsbery31-Mar-09 6:27
Mark Salsbery31-Mar-09 6:27 
QuestionPop-up Blocker for cable boxes Pin
Quecumber25629-Mar-09 13:40
Quecumber25629-Mar-09 13:40 
QuestionWhy does False = True !?!?!?!? [modified] Pin
Xpnctoc28-Mar-09 12:08
Xpnctoc28-Mar-09 12:08 
AnswerIt's a VS 2008 Watch window bug! Pin
Xpnctoc29-Mar-09 10:08
Xpnctoc29-Mar-09 10:08 
QuestionPassing pointer to C++ function from VC++ Pin
Kurt Richardson27-Mar-09 8:36
Kurt Richardson27-Mar-09 8:36 
AnswerRe: Passing pointer to C++ function from VC++ Pin
Mark Salsbery27-Mar-09 10:38
Mark Salsbery27-Mar-09 10:38 
GeneralRe: Passing pointer to C++ function from VC++ Pin
Kurt Richardson30-Mar-09 7:22
Kurt Richardson30-Mar-09 7:22 
QuestionWrapper for CDialog class in C++/CLI dll Pin
Oldboy227-Mar-09 6:05
Oldboy227-Mar-09 6:05 
AnswerRe: Wrapper for CDialog class in C++/CLI dll Pin
Mark Salsbery27-Mar-09 6:42
Mark Salsbery27-Mar-09 6:42 
GeneralRe: Wrapper for CDialog class in C++/CLI dll Pin
led mike27-Mar-09 8:50
led mike27-Mar-09 8:50 
GeneralRe: Wrapper for CDialog class in C++/CLI dll Pin
Mark Salsbery27-Mar-09 8:55
Mark Salsbery27-Mar-09 8:55 
GeneralRe: Wrapper for CDialog class in C++/CLI dll Pin
Oldboy231-Mar-09 14:59
Oldboy231-Mar-09 14:59 
Questionshort cut key to a button ... Pin
m_mun25-Mar-09 23:09
m_mun25-Mar-09 23:09 
AnswerRe: short cut key to a button ... Pin
N a v a n e e t h25-Mar-09 23:32
N a v a n e e t h25-Mar-09 23:32 

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.