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

Managed C++/CLI

 
GeneralRe: What is your damage? Pin
George L. Jackson8-Apr-09 13:45
George L. Jackson8-Apr-09 13:45 
GeneralRe: What is your damage? Pin
led mike9-Apr-09 8:34
led mike9-Apr-09 8:34 
GeneralRe: a managed array cannot have this element type Pin
Mark Salsbery9-Apr-09 6:57
Mark Salsbery9-Apr-09 6:57 
GeneralRe: a managed array cannot have this element type Pin
Member 20210229-Apr-09 8:17
Member 20210229-Apr-09 8:17 
GeneralRe: a managed array cannot have this element type Pin
led mike9-Apr-09 8:37
led mike9-Apr-09 8:37 
GeneralRe: a managed array cannot have this element type Pin
Mark Salsbery9-Apr-09 8:53
Mark Salsbery9-Apr-09 8:53 
GeneralRe: a managed array cannot have this element type Pin
Member 202102210-Apr-09 4:41
Member 202102210-Apr-09 4:41 
QuestionSaveFileDialog and OpenFileDialog in C++/CLI Pin
Epi7-Apr-09 22:20
Epi7-Apr-09 22:20 
AnswerRe: SaveFileDialog and OpenFileDialog in C++/CLI Pin
Eslam Afifi7-Apr-09 22:43
Eslam Afifi7-Apr-09 22:43 
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 

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.