Click here to Skip to main content
15,917,320 members
Home / Discussions / C#
   

C#

 
QuestionShowing a record Set on WIndows C# form Pin
Muhammad Ahmed2-Feb-07 4:03
Muhammad Ahmed2-Feb-07 4:03 
AnswerRe: Showing a record Set on WIndows C# form Pin
bobsugar2222-Feb-07 4:08
bobsugar2222-Feb-07 4:08 
Questiondeserialization Pin
mihksoft2-Feb-07 3:49
mihksoft2-Feb-07 3:49 
AnswerRe: deserialization Pin
Judah Gabriel Himango2-Feb-07 4:58
sponsorJudah Gabriel Himango2-Feb-07 4:58 
QuestionInvoking function from out of process DLL Pin
Abhi Lahare2-Feb-07 3:47
Abhi Lahare2-Feb-07 3:47 
AnswerRe: Invoking function from out of process DLL Pin
parsiphal2-Feb-07 5:00
parsiphal2-Feb-07 5:00 
GeneralRe: Invoking function from out of process DLL Pin
Abhi Lahare2-Feb-07 6:33
Abhi Lahare2-Feb-07 6:33 
GeneralRe: Invoking function from out of process DLL Pin
parsiphal5-Feb-07 2:59
parsiphal5-Feb-07 2:59 
Hi, sorry for get you answeret a bit late. I was heavily involved with a few thing here and there.

Having you defined MyObj as object, it's not surprising Type is Sustem.Object.
With that test we are also testing against any possible derived class instanced and handled by Object. So definitely we can say the object you are handling is not ServerDLL.Class1, and therefore the answer to your first question should be: "you get null because no such a method exist in the instance".

I asked you to write a little demo for me to play with, just to be sure of running same condition you have (even if no logic is to be included in the demo: just a Console.Writeline "Method xxx called" would work: i'm not interested in spying what you are doing Smile | :) ).

In my opinion, may be the instance you are handling is still Class1 type, but masquerade by the object declaration. Try to verify this with your IDE, putting a break point on the first line of your test, than putting MyObj under watch and drilling the tree (expanding '+') looking for some that can tell you: there's a Class1 under the cover; otherwise to estabilish which instance have you taken from memory.
I'm not sure what you are getting since I'm not aware of the complexity of your application.

If you can say either you handle or not a Class1 instance, you can say some on the first line of your snippet, that is: obtaining the instance.
From there you can see if it is a matter of member protection (public, private, protected), or some modifier than can prevent you from accessing that memeber.

If still is plumbing, consider to split you code-line to examine each step and its result.
If you are not able to have a MemberInfo Instance of the nethod you want to invoke, invocation will never be possibile: consider splitting the problem in prerequisite and action, so to say Smile | :)

I can show you a couple of way to instancing a class by reflection, but no other to obtaining a reference to an istance: I think either is correct and the problem is elsewhere, or it is not fully correct.

Hope this can help Smile | :)

P.S. Feel free to send me an example that can reproduce the behavior for me to play around with: I will give you some closer advice perhaps Wink | ;)

Parsiphal

AnswerRe: Invoking function from out of process DLL Pin
Judah Gabriel Himango2-Feb-07 5:00
sponsorJudah Gabriel Himango2-Feb-07 5:00 
GeneralRe: Invoking function from out of process DLL Pin
Abhi Lahare2-Feb-07 6:10
Abhi Lahare2-Feb-07 6:10 
GeneralRe: Invoking function from out of process DLL Pin
Judah Gabriel Himango2-Feb-07 6:33
sponsorJudah Gabriel Himango2-Feb-07 6:33 
GeneralRe: Invoking function from out of process DLL Pin
Abhi Lahare5-Feb-07 9:21
Abhi Lahare5-Feb-07 9:21 
GeneralRe: Invoking function from out of process DLL Pin
Judah Gabriel Himango5-Feb-07 9:43
sponsorJudah Gabriel Himango5-Feb-07 9:43 
Questioncompact framework Pin
Edwin_Olo2-Feb-07 3:12
Edwin_Olo2-Feb-07 3:12 
AnswerRe: compact framework Pin
george ivanov2-Feb-07 3:20
george ivanov2-Feb-07 3:20 
GeneralRe: Which user has the file open? Pin
RugbyLeague2-Feb-07 2:32
RugbyLeague2-Feb-07 2:32 
Questionjavascript code Pin
acodman2-Feb-07 2:21
acodman2-Feb-07 2:21 
AnswerRe: javascript code Pin
Ravi Bhavnani2-Feb-07 3:00
professionalRavi Bhavnani2-Feb-07 3:00 
GeneralRe: javascript code Pin
badgrs2-Feb-07 4:14
badgrs2-Feb-07 4:14 
QuestionHow to set CurrentCell in DataGrid Pin
george ivanov2-Feb-07 2:11
george ivanov2-Feb-07 2:11 
AnswerRe: How to set CurrentCell in DataGrid Pin
andre_swnpl2-Feb-07 2:21
andre_swnpl2-Feb-07 2:21 
GeneralRe: How to set CurrentCell in DataGrid Pin
george ivanov2-Feb-07 2:38
george ivanov2-Feb-07 2:38 
QuestionGet parameters in Windows Forms App Pin
blackjack21502-Feb-07 1:59
blackjack21502-Feb-07 1:59 
AnswerRe: Get parameters in Windows Forms App Pin
andre_swnpl2-Feb-07 2:12
andre_swnpl2-Feb-07 2:12 
GeneralRe: Get parameters in Windows Forms App Pin
bobsugar2222-Feb-07 3:28
bobsugar2222-Feb-07 3:28 

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.