How bad is typecasting .Net references?
#1
Posted 24 February 2012 - 05:31 PM
It works okay while smoke testing, but I'm not very comfortable with it at all. I don't know the underlying mechanics of how LV maps property nodes to .Net accessors, leaving me wondering what kinds of failures I'm likely to see. Anyone have insight they'd like to share?
Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.
Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.
There are two secrets to success:
Secret #1 - Never tell everything you know.
#2
Posted 24 February 2012 - 07:29 PM
#3
Posted 24 February 2012 - 10:08 PM
Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.
Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.
There are two secrets to success:
Secret #1 - Never tell everything you know.
#4
Posted 25 February 2012 - 04:00 AM
I take it these objects are unrelated, so you can't do proper dynamic casts via the to more specific primitive?
#5
Posted 26 February 2012 - 05:26 PM
I don't really know how they are related as I don't have access to the .Net source code. If I were to guess I would say they might be siblings, but they're actually interfaces--not concrete classes--and they may not be in any sort of inheritance hierarchy.I take it these objects are unrelated, so you can't do proper dynamic casts via the to more specific primitive?
Here's a snippet showing the full property nodes before and after the typecast. Oddly, the SteppedLevelGenerator property node (before typecasting) always returns error 1172 while the FrequencySweepGenerator node (after typecasting) does not.
[Grrr... my premium membership incorrectly expired and I'm over the freebie upload quota. I'll try to upload it once I get my membership sorted out.]
Edited by Daklu, 26 February 2012 - 05:27 PM.
Certified LabVIEW Architect
Dak's First Law of Problem Solving: If the solution looks simple, I don't know enough about the problem.
Yes, the QSM is flexible. So is Jello. That doesn't make it good construction material.
There are two secrets to success:
Secret #1 - Never tell everything you know.
#6
Posted 27 February 2012 - 11:20 AM
I don't really know how they are related as I don't have access to the .Net source code. If I were to guess I would say they might be siblings, but they're actually interfaces--not concrete classes--and they may not be in any sort of inheritance hierarchy.
You might be able to get information about their relationship without source code. Use IL disassembler (ildasm.exe) that ships with the .NET SDK.












