473,322 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Porting 1.1 to 2.0, Behind the scenes

Udi
Hi,
I have a function that I need to call in reflection that has an out
parameter.
The following code works fine on VS2003, but not on 2005.
(I'm not receiving the out values)

Good on 2003, Bad on 2005
~~~~~~~~~~~~~~~~~~~~~
ArrayList myArgs = new ArrayList();
myArgs.Add( outVal );
obj.GetType().InvokeMember( "GetValue", BindingFlags.SetProperty |
BindingFlags.Public | BindingFlags.Instance,
null,
obj,
(Object [])myArgs.ToArray(typeof(Object)) // FAILS ON 2005
);
However, this fixes the problem:

Good on 2005
~~~~~~~~~~~
object [] myArgs = {new int() };
obj.GetType().InvokeMember( "Memory", BindingFlags.SetProperty |
BindingFlags.Public | BindingFlags.Instance,
null,
obj,
myArgs) // WORKS FINE
);

I gues this is related to a temporary array that gets lost.
Can anyone explain what's exactly happening behind the scenes, or point
me to some links?
Thanks!
Udi.

Jul 20 '06 #1
0 831

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Wolfgang Keller | last post by:
Hello, as a non-developer I am currently participating in an industrial "research" project to develop a so-called "web application". This application serves at the same time as middleware to...
6
by: Mountain Bikn' Guy | last post by:
When one gets a row from a database (ie, a DataTable), the row contains a typed value in each column. How is this typically implemented behind scenes. I want to build this functionality myself. The...
2
by: Larry Foulkrod | last post by:
I would like to learn what physically happens behind the scenes when I add references to a project and then build an assembly. If the reference were part of the mscorlib would the action taken by...
6
by: Kentamanos | last post by:
Please don't ask me why I'm doing this (trust me, it makes sense in my system), but I'd like to basically redirect requests for a certain extension (thus a handler) to an ASPX page behind the scenes....
1
by: z. f. | last post by:
Hi, adding a control with runat=server to an aspx page (using code - not designer view) - don't cause the control to be added to the code behind (.cs ot .vb file) only if i change the aspx...
1
by: Chris Simmons | last post by:
Hello: I am trying to better understand the HttpResponse.Filter property and, although I think I "get it," I am wondering what is going on behind the scenes. I was initially stumped with the...
1
by: mplutodh1 | last post by:
This may seem like an odd thing to do, but is there a way to blindly post to a form. By that I mean, sending data (First_Name=John) without actually having the browser go to that page? I am...
2
by: walter | last post by:
Hi, when I add a new page in my asp.net 2 project and put some controls there, everything works fine until I move the code behind into App_Code folder.--When I compile , it tells me that control...
1
by: Udi | last post by:
Hi All, I have a function that I need to call on reflection that has an out parameter (maybe more than one). My problem is that I'm not receiving the out values. The following code works fine...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.