Announcement

Collapse
No announcement yet.

Object Let

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Object Let

    In some of David's code using the VideoCapX OCX, he used this:

    Code:
    Local vVar as Variant
     vVar=%FALSE As Long : Object Let oOcx.PreviewAudio = vVar ' no audio
    Help says the variables can be LONG, so this works as well:

    Code:
    Local v as Long
    v = %False : Object Let oOCX.PreviewAudio = v
    If there any reason to use the Variant variable instead of a Long variable? For repeated calls, I'd guess the Variant variable would slow things down just a bit?

    #2
    When using COM Automation, all the parameters are variants. Therefore, if you use a Long directly, what will happen is that PB will do the conversion for you and the final result will be the same.

    COM Automation calls methods using the Invoke method of the IDispatch interface. Invoke suses a DISPPARAMS structure ( https://docs.microsoft.com/en-us/win...idl-dispparams ) whose first member is a pointer to an array of variants.

    You can use native data types instead of variants using direct interface calls, if the OCX has a dual interface.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


      #3
      Howdy, Jose!

      ...what will happen is that PB will do the conversion for you
      Thank you for the clarification!

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎