Click here to Skip to main content
11,479,841 members (49,230 online)
   

C#

 
GeneralRe: Partial class: is this a bug? Pin
PHS2413-Mar-13 8:49
memberPHS2413-Mar-13 8:49 
GeneralRe: Partial class: is this a bug? Pin
PHS2416-Mar-13 6:53
memberPHS2416-Mar-13 6:53 
Questioneven numbers table Pin
Yrtsg1-Mar-13 23:11
memberYrtsg1-Mar-13 23:11 
AnswerRe: even numbers table Pin
harold aptroot2-Mar-13 0:29
memberharold aptroot2-Mar-13 0:29 
QuestionC# Console.ReadLine runns out of memory Pin
dcof1-Mar-13 9:45
memberdcof1-Mar-13 9:45 
AnswerRe: C# Console.ReadLine runns out of memory Pin
Jibesh1-Mar-13 10:13
memberJibesh1-Mar-13 10:13 
AnswerRe: C# Console.ReadLine runns out of memory Pin
OriginalGriff1-Mar-13 22:59
mvpOriginalGriff1-Mar-13 22:59 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 9:07
memberdcof2-Mar-13 9:07 
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell2-Mar-13 11:26
memberjschell2-Mar-13 11:26 
GeneralRe: C# Console.ReadLine runns out of memory Pin
dcof2-Mar-13 12:26
memberdcof2-Mar-13 12:26 
GeneralRe: C# Console.ReadLine runns out of memory Pin
jschell3-Mar-13 6:54
memberjschell3-Mar-13 6:54 
QuestionTrying to use child class method by overriding parent Pin
MichCl1-Mar-13 9:26
memberMichCl1-Mar-13 9:26 
AnswerRe: Trying to use child class method by overriding parent Pin
OriginalGriff1-Mar-13 9:41
mvpOriginalGriff1-Mar-13 9:41 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc [modified] Pin
MichCl1-Mar-13 10:30
memberMichCl1-Mar-13 10:30 
It's possible that's the problem. My object instance is created with Reflection:

_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 11:30
memberjschell2-Mar-13 11:30 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl5-Mar-13 3:23
memberMichCl5-Mar-13 3:23 
GeneralRe: Trying to use child class method by overriding parent; using Reflection to invoke class etc Pin
MichCl5-Mar-13 10:40
memberMichCl5-Mar-13 10:40 
QuestionPassing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 6:42
memberJimmyRopes1-Mar-13 6:42 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
harold aptroot1-Mar-13 8:13
memberharold aptroot1-Mar-13 8:13 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 8:39
memberJimmyRopes1-Mar-13 8:39 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
harold aptroot1-Mar-13 8:50
memberharold aptroot1-Mar-13 8:50 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 13:50
memberJimmyRopes1-Mar-13 13:50 
AnswerRe: Passing parameters from unmanaged code to managed code by reference Pin
Eddy Vluggen1-Mar-13 9:31
mvpEddy Vluggen1-Mar-13 9:31 
GeneralRe: Passing parameters from unmanaged code to managed code by reference Pin
JimmyRopes1-Mar-13 15:15
memberJimmyRopes1-Mar-13 15:15 
Questionrecord mouse coordinates when mouse is clicked on inkcanvas Pin
Naman20071-Mar-13 5:59
memberNaman20071-Mar-13 5:59 
AnswerRe: record mouse coordinates when mouse is clicked on inkcanvas Pin
Simon_Whale1-Mar-13 6:30
memberSimon_Whale1-Mar-13 6:30 
GeneralRe: record mouse coordinates when mouse is clicked on inkcanvas Pin
Naman20071-Mar-13 6:35
memberNaman20071-Mar-13 6:35 
GeneralRe: record mouse coordinates when mouse is clicked on inkcanvas Pin
Simon_Whale1-Mar-13 6:38
memberSimon_Whale1-Mar-13 6:38 
QuestionDotSpatial.Positioning.NmeaInterpreter Pin
loctrice1-Mar-13 4:01
memberloctrice1-Mar-13 4:01 
AnswerRe: DotSpatial.Positioning.NmeaInterpreter Pin
Eddy Vluggen1-Mar-13 5:57
mvpEddy Vluggen1-Mar-13 5:57 
GeneralRe: DotSpatial.Positioning.NmeaInterpreter Pin
loctrice1-Mar-13 6:04
memberloctrice1-Mar-13 6:04 
GeneralRe: DotSpatial.Positioning.NmeaInterpreter Pin
Eddy Vluggen1-Mar-13 6:10
mvpEddy Vluggen1-Mar-13 6:10 
Questionsdk Pin
RAJESHSELVARAJ1-Mar-13 0:04
memberRAJESHSELVARAJ1-Mar-13 0:04 
AnswerRe: sdk Pin
Pete O'Hanlon1-Mar-13 0:24
protectorPete O'Hanlon1-Mar-13 0:24 
AnswerRe: sdk Pin
Dave Kreskowiak1-Mar-13 3:21
mvpDave Kreskowiak1-Mar-13 3:21 
QuestionIssue using the StreamWritter Class Pin
TwiztedFreek28-Feb-13 14:16
memberTwiztedFreek28-Feb-13 14:16 
AnswerRe: Issue using the StreamWritter Class Pin
TwiztedFreek28-Feb-13 14:18
memberTwiztedFreek28-Feb-13 14:18 
AnswerRe: Issue using the StreamWritter Class Pin
Garth J Lancaster28-Feb-13 15:08
memberGarth J Lancaster28-Feb-13 15:08 
AnswerRe: Issue using the StreamWritter Class Pin
Jegan Thiyagesan1-Mar-13 0:33
memberJegan Thiyagesan1-Mar-13 0:33 
AnswerRe: Issue using the StreamWritter Class Pin
Keith Barrow1-Mar-13 2:06
mentorKeith Barrow1-Mar-13 2:06 
AnswerRe: Issue using the StreamWritter Class Pin
Defens931-Mar-13 10:35
memberDefens931-Mar-13 10:35 
QuestionCopy username from text file to website Pin
Muhammad Sayyam28-Feb-13 3:17
memberMuhammad Sayyam28-Feb-13 3:17 
AnswerRe: Copy username from text file to website Pin
DaveyM6928-Feb-13 4:07
mentorDaveyM6928-Feb-13 4:07 
GeneralRe: Copy username from text file to website Pin
Richard MacCutchan28-Feb-13 4:23
mvpRichard MacCutchan28-Feb-13 4:23 
GeneralRe: Copy username from text file to website Pin
DaveyM6928-Feb-13 11:30
mentorDaveyM6928-Feb-13 11:30 
GeneralRe: Copy username from text file to website Pin
Muhammad Sayyam2-Mar-13 21:19
memberMuhammad Sayyam2-Mar-13 21:19 
GeneralRe: Copy username from text file to website Pin
DaveyM695-Mar-13 4:08
mentorDaveyM695-Mar-13 4:08 
GeneralRe: Copy username from text file to website Pin
DaveyM697-Mar-13 22:51
mentorDaveyM697-Mar-13 22:51 
Questiontooth numbers Pin
Jassim Rahma28-Feb-13 1:35
memberJassim Rahma28-Feb-13 1:35 
AnswerRe: tooth numbers Pin
Pete O'Hanlon28-Feb-13 2:11
protectorPete O'Hanlon28-Feb-13 2:11 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 23 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid