candidus Posted October 15, 2009 Report Share Posted October 15, 2009 Hi there, I looked for a way to get the IID from an ActiveX Refnum. So I looked at the TypeDescriptor and fortunately it contains not only the IID but also the CLSID and TypeLibrary of the underlying interface. But I'm still looking for a way to Check whether my Input Variant contains an ActiveX Refnum. I can check for Refnum, but it must be an _ActiveX_ Refnum, else my VI has to return an error. Currently I'm checking the length of the TD but I don't think that's an error-proof solution. Has anyone a better idea? GUIDsFromAxRefnum.vi Quote Link to comment
asbo Posted October 15, 2009 Report Share Posted October 15, 2009 Is there some reason you can't use an Automation reference and Variant To Data? ActiveXVariantToAutomationRefnum.vi 1 Quote Link to comment
candidus Posted October 15, 2009 Author Report Share Posted October 15, 2009 Is there some reason you can't use an Automation reference and Variant To Data? ActiveXVariantToAutomationRefnum.vi Great! I didn't think about that but it's exactly what I was looking for. Thank you very much! Quote Link to comment
Aitor Solar Posted October 15, 2009 Report Share Posted October 15, 2009 If you still want to test the variant type before trying the variant casting, the 6th byte in the typedesc will tell you the refnum type (value 7 is for ActiveX Automation references). Though I do agree the other way is probably faster. Saludos, Aitor Quote Link to comment
candidus Posted October 15, 2009 Author Report Share Posted October 15, 2009 If you still want to test the variant type before trying the variant casting, the 6th byte in the typedesc will tell you the refnum type (value 7 is for ActiveX Automation references). Though I do agree the other way is probably faster. Saludos, Aitor Thank you! I already noticed that this byte must have something to do with the Refnum type but I was unsure. Is there any documentation about that? The LV documentation tells something about TDs of plain types but not much about Refnum TDs... Quote Link to comment
ShaunR Posted October 15, 2009 Report Share Posted October 15, 2009 Thank you! I already noticed that this byte must have something to do with the Refnum type but I was unsure. Is there any documentation about that? The LV documentation tells something about TDs of plain types but not much about Refnum TDs... Refnum Data Types Quote Link to comment
candidus Posted October 15, 2009 Author Report Share Posted October 15, 2009 I missed this information several times before... Many thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.