Anders Björk Posted May 11, 2007 Report Share Posted May 11, 2007 I have a COM object that is suppose to give a reference to another object but it gives a variant and here comes the problem. I dont have a clue if it solvable or not. I have tried from variant with a an constant to the subobject as type but that didnt work. According to the object documentation the second object is only reachable throught the first. All ideas are appreciated. http://forums.lavag.org/index.php?act=attach&type=post&id=5805 Quote Link to comment
Herbert Posted May 11, 2007 Report Share Posted May 11, 2007 If you get a variant out of an ActiveX node that is supposed to represent another ActiveX object, you need to cast it into the object you are looking for. You can use the "Variant To Data" function for that. Wire the "type" terminal with a refnum constant that represents the ActiveX object type you expect. Herbert Quote Link to comment
Anders Björk Posted May 12, 2007 Author Report Share Posted May 12, 2007 QUOTE(Herbert @ May 10 2007, 08:12 PM) If you get a variant out of an ActiveX node that is supposed to represent another ActiveX object, you need to cast it into the object you are looking for. You can use the "Variant To Data" function for that. Wire the "type" terminal with a refnum constant that represents the ActiveX object type you expect.This is the way it's supposed to be done. If that fails, the most likely cause is that you are trying to cast to a type that is not what's in the variant. Variants are often used for ActiveX refnums if the property/method can potentially return different types of interfaces. Herbert Thanks! It work when I tried again. 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.