|
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 ).
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
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
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
Parsiphal
|
|
|
|
|
Is SomeFunction a public function? If not, you'll need to specify an additional BindingFlag, something like
MyObj.GetType().GetMethod("SomeFunction", BindingFlags.InvokeMethod | BindingFlags.NonPublic);
|
|
|
|
|
Hi Judah Himango
Thanks a lot for your reply. It is a private function I have added the BindingFlafs.NonPublic option. but no luck Its still giving null for call.
Regards
Abhi Lahare
|
|
|
|
|
Is it static or an instance method? You'll need to specify that in the binding flags there as well.
|
|
|
|
|
Thanks Judah,
Sorry for delay, my method is a simple private method.
Thanks
Abhishake Lahare
|
|
|
|
|
Then you'll need to specify that it is an instance method in the BindingFlags as well.
|
|
|
|
|
how to dispaly in compact framework WAIT ICON (sandglass)
|
|
|
|
|
Cursor.Current = Cursors.WaitCursor;
Cursor.Current = Cursors.Default;
|
|
|
|
|
That's what I am doing at the moment but it adds an extra step. I am quite happy for that to happen but I just thought it would be nice if it saved automatically in the directory it is destined for.
|
|
|
|
|
Hi all,
can someone help me out with a javascript that can disable or hide address bar on browsers on page_load.
I mean when I run my c# page and it loads succesfully, it shoudn't show the address bar.
|
|
|
|
|
acodman wrote: javascript that can disable or hide address bar on browsers on page_load.
See this[^] link.
Imho, you're better off asking this question in the Web Development[^] forum.
/ravi
|
|
|
|
|
Or even better not trying to control the users web browser - its their browser let them decide what they see!
|
|
|
|
|
CurrentCell.ColumnNumber and CurrentCell.RowNumber are read-only properties and can not be changed. So, how can any cell from grid be set as current cell (selected and focused).
thanks.
|
|
|
|
|
are you using Not net 2.0? if so have you tried the following?
this.dataGridView1.CurrentCell = this.dataGridView1[2, 0];
|
|
|
|
|
i'm using Net2.0 but this is not working
grid.CurrentCell = (DataGridCell)grid[3, 3];
InvalidCastException
the control is not DataGridView but DataGrid
|
|
|
|
|
Hi.
How can I read command line parameters used to call a Windows Form Application?
I use VS2005 to create a new Windows application. The autogenerated Program.cs fle looks like this:
....<br />
static class Program<br />
{ <br />
[STAThread]<br />
static void Main()<br />
{<br />
Application.EnableVisualStyles();<br />
Application.SetCompatibleTextRenderingDefault(false);<br />
Application.Run(new MainFrm());<br />
}<br />
}<br />
....
Shouldn't the Main method header include a parameter for arguments?
Can I add it by hand? Are there any other options?
Thanks.
|
|
|
|
|
feel free to add the arguments to Main function. This wil stil work with windows forms
eg. static void Main(string[] args)
|
|
|
|
|
You don't need to do that, you can just call:
string[] args = Environment.GetCommandLineArgs();
FYI, args[0] is the app file name.
|
|
|
|
|
|
I created a Report using CR in .NET. The report has a couple of decimal fields .I want the output to look like : $55,345.06. I formatted the the fields by right clicking it, selecting the Number Tab and selecting the "Custom Style" option. The sample output showed $55,555.56. But when I ran the report I am getting values like 3456.6700. I am not getting the Dollar prefix and the output is not rounded to 2 decimal places.
Am I missing something? Please let me know
rs
|
|
|
|
|
This is the tipical behavior in a situation like this:
- at design time, you have a number field, and you assign a number format to it.
- at run time, you have not a number value (e.g: it is a string value)
in such a case, format won't apply due to a internal exception handling, I suppose, you have not any signal.
Hope this help
Parsiphal
|
|
|
|
|
Thanks for the reply.
Not sure if I got it . I am new to Crystal Reports.
How do I take care of the exception handling and fix the problem
rs
|
|
|
|
|
Hello guys , i am trying to write smtp server .
there is two problems .
first when i run my server on port 25 it doesn't make clients connect on my pc knowing that this port is free to use on my computer host because i didn't install smtp server that comes in package with IIS6. i didn't install the smtp server that comes with the web server in order to be able to use port 25 but in vain i can't connect clients to send mails in my server on port 25 .
whereas i changed the port number just for testing to 23 and i successfully connect to it using telnet.
second problem:
--------------
i need a good solution to create smtp parser , any body did that before please , please help me please cause i need to create a parser to parse smtp messages in c#
Human knowledge belongs to the world.
|
|
|
|
|
snouto wrote: can't connect clients to send mails in my server on port 25
Does the bind() succeed on 25?
snouto wrote: i need a good solution to create smtp parser
The SMTP protocol is public. You can find documentation for it all over the internet. http://www.google.com/search?hl=en&q=SMTP+RFC&btnG=Search[^]
led mike
|
|
|
|
|
pls suggest me an upload progressbar control(ASP.net, c#) that shows me how much an image has been copied from one location to another.
thanks.
|
|
|
|