Problems with InvokeMember()



Hello,

I have a problem and the search don´t match a result:
I am trying to change the value of public attribute of type double,
which name i am getting at runtime. I was trying to use
Type.InvokeMember()... and now my question:

How is it possible to change an attribute of an object at the runtime
via 'Invoke.Member'?
The example from MSDN works fine for strings ,but it's not working for
primitives like 'double'


Type mtype = m.GetType();
mtype.InvokeMember("AttributName", BindingFlags.SetField, null, m,
2.5);

//m.AttributName is double


Thanks al lot
Jan

PS: I hope I have made my first post correctly

.



Relevant Pages

  • Re: How to make a string out of a symbol?
    ... character type is the same as fixnum, and to encode strings you'd just ... (defun get-value (tagged-value) ... Now of course you can't do real I/O with these primitives, ... get a string to feed INTERN is imaginarily solved. ...
    (comp.lang.lisp)
  • Re: Java compatibility issues (WAS: MF having issues?)
    ... In the case of Strings, "equals" compares the contents of the strings for equality. ... The above kind of construct perpetuates this illusion that Strings are like primitives. ... So "normally", I'd say "no", and that the above construct would detract from the elegance of the language. ...
    (comp.lang.cobol)
  • Re: Interfacing question
    ... include data in a gazillions forms, but fundamentally that are all bits ... a few strings, integers ... etc. that could easily be returned using a function call as var types ... Prev by Date: ...
    (microsoft.public.vb.general.discussion)
  • Re: Printf problem with big numbers....
    ... But I changed my algorithm, and now work directly in base 2, and ... instead of printing the results in base 10 or base 2, ... strings, and not with numbers, so it is ok. ... Prev by Date: ...
    (comp.lang.c)
  • Re: dependency-detection in java
    ... Strings and primitives. ... that javac can't inline regular object references, ...
    (comp.lang.java.programmer)