473,386 Members | 1,734 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,386 software developers and data experts.

InvokeMember throws a NotSupportedException

Hi all
I have a code for .NET Compact 2.0:
if (elementType.GetProperty("Items") != null)
{
Type itemsType =
elementType.GetProperty("Items").PropertyType;
object itemsObj =
elementType.InvokeMember("Items",
BindingFlags.Instance |
BindingFlags.DeclaredOnly |
BindingFlags.Public |
BindingFlags.NonPublic |
BindingFlags.GetProperty,
null,
formControls[ArrayPosition][currElement], null);
foreach (XmlNode item in
element.FirstChild.ChildNodes)
{
itemsType.InvokeMember("Add",
BindingFlags.Instance |
BindingFlags.Public |

BindingFlags.InvokeMethod,
null, itemsObj, new
Object[] { item.FirstChild.Value });
}
}

The row elementType.InvokeMember(...) throws a NotSupportedException.
Same code for regular .NET works fine.
Does it mean .NET Compact 2.0 doesn't support such invocation at all?

May 17 '07 #1
0 1209

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

Similar topics

7
by: hazz | last post by:
this is a repost with more concise code (well, for me) and better questions (I hope....) . given the following two classes, my intent is to use either Activator.CreateInstance or InvokeMember pass...
0
by: Alex Zhitlenok | last post by:
Hi, On Google, one can find a lot of statements that Invoke and InvokeMemeber work alike. However, my own experience contradicts this statement. 1. Surprisingly, Invoke and InvokeMember methods...
3
by: Russell Smith | last post by:
I am creating an Excel add-in. Please note project type is Shared Add-in vice Excel Workbook. In the OnStartupComplete event handler I am adding a new menu item. I start by getting a reference...
0
by: Meetali Goel | last post by:
Hi all, I can't determine why I keep getting "NotSupportedException" when g.MeasureString() is called in the following code (.NET CE). I have spent several hours but I cant seem to find the...
0
by: eirik hoem | last post by:
I have a problem using InvokeMember. I have a client application that loads a set of assemblies runtime. It creates instances of them and calls a method which I specify in a XML file. What...
0
by: eirik hoem | last post by:
case-block was followed by a ; that's what you get for 13hrs straight ------------------------ I have a problem using InvokeMember. I have a client application that loads a set of assemblies...
4
by: Howard Kaikow | last post by:
I am trying to retrive some WMI properties using Option Strict On. This requires the use of InvokeMember. I know that there are alternative ways to get the values, but I want to learn how to...
0
by: Ralfeus | last post by:
Hi all. I'm developing a software for Windows Mobile 2003. I have such code: Control currControl = formControls ; if (elementType.GetProperty("Items") != null) { Type itemsType =...
1
by: tommyk | last post by:
I am writing a small program that reads a text file filled with a large number of IP addresses and attempts to add them to IIS so that they will be blocked. For some reason, about one in every...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.