Click here to Skip to main content
15,885,365 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Console.ReadLine runns out of memory Pin
OriginalGriff1-Mar-13 21:59
mveOriginalGriff1-Mar-13 21:59 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 8:07
dcof2-Mar-13 8:07 
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell2-Mar-13 10:26
jschell2-Mar-13 10:26 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 11:26
dcof2-Mar-13 11:26 
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell3-Mar-13 5:54
jschell3-Mar-13 5:54 
QuestionTrying to use child class method by overriding parent Pin
MichCl1-Mar-13 8:26
MichCl1-Mar-13 8:26 
AnswerRe: Trying to use child class method by overriding parent Pin
OriginalGriff1-Mar-13 8:41
mveOriginalGriff1-Mar-13 8:41 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl1-Mar-13 9:30
MichCl1-Mar-13 9:30 
It's possible that's the problem. My object instance is created with Reflection:

C#
_assembly = Assembly.LoadFrom(programDll);
_type = _assembly.GetType("CrWriter.PC");
_objectInstance = Activator.CreateInstance(_type);
_parameters = new Object[] { cb1, programDll, templateArr, itsDll, cert, i, cb1.cbInfos[i].boxID };
controls[i] = new Control();
//The following lands in my child's GetPC method
//My parent also has a method called GetPC
controls[i] = (Control)_type.InvokeMember("GetPC", BindingFlags.Default | BindingFlags.InvokeMethod, null, _objectInstance, _parameters);

controls[i].Dock = DockStyle.None;
this.Controls.Add(controls[i]);


Since my Invocation of GetPC lands in the child class and not the parent, it must be created correctly. So I'm not sure why it's not landing in the correct ValidateDynData method. Maybe I need to cast my object to the programDll somehow. When I run the program and inspect the _objectInstance it could be a problem:
variable.............................................................value
base: {GenericCrWriter.GenericPC} ......CrWriter.PC
baseInst: .........................................................GenericCrWriter.GenericPC

But then, the _assembly is referring to Ko/PC and not Generic/GenericPC.

Also, my _assembly.GetType looks good. My Generic/parent doesn't have anything named CrWriter.PC

I wonder if there is a way to cast an object obtained through reflection?

modified 1-Mar-13 15:56pm.

GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
jschell2-Mar-13 10:30
jschell2-Mar-13 10:30 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl5-Mar-13 2:23
MichCl5-Mar-13 2:23 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl5-Mar-13 9:40
MichCl5-Mar-13 9:40 
QuestionPassing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 5:42
professionalJimmyRopes1-Mar-13 5:42 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
harold aptroot1-Mar-13 7:13
harold aptroot1-Mar-13 7:13 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 7:39
professionalJimmyRopes1-Mar-13 7:39 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
harold aptroot1-Mar-13 7:50
harold aptroot1-Mar-13 7:50 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 12:50
professionalJimmyRopes1-Mar-13 12:50 
AnswerRe: Passing parameters from unmanaged code to managed code by reference Pin
Eddy Vluggen1-Mar-13 8:31
professionalEddy Vluggen1-Mar-13 8:31 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 14:15
professionalJimmyRopes1-Mar-13 14:15 
Questionrecord mouse coordinates when mouse is clicked on inkcanvas Pin
Naman20071-Mar-13 4:59
Naman20071-Mar-13 4:59 
AnswerRe: record mouse coordinates when mouse is clicked on inkcanvas Pin
Simon_Whale1-Mar-13 5:30
Simon_Whale1-Mar-13 5:30 
GeneralRe: record mouse coordinates when mouse is clicked on inkcanvas Pin
Naman20071-Mar-13 5:35
Naman20071-Mar-13 5:35 
GeneralRe: record mouse coordinates when mouse is clicked on inkcanvas Pin
Simon_Whale1-Mar-13 5:38
Simon_Whale1-Mar-13 5:38 
QuestionDotSpatial.Positioning.NmeaInterpreter Pin
loctrice1-Mar-13 3:01
professionalloctrice1-Mar-13 3:01 
AnswerRe: DotSpatial.Positioning.NmeaInterpreter Pin
Eddy Vluggen1-Mar-13 4:57
professionalEddy Vluggen1-Mar-13 4:57 
GeneralRe: DotSpatial.Positioning.NmeaInterpreter Pin
loctrice1-Mar-13 5:04
professionalloctrice1-Mar-13 5:04 

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.