Jump to content

COM component that gives a variant instead of reference


Recommended Posts

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

Link to comment

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

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.