• programming: A scripting object returning values using a VarArray - a VT_BYREF problem

    From R.Wieser@address@is.invalid to comp.os.ms-windows.programmer.win32,alt.windows7.general on Mon Apr 27 11:46:28 2026
    From Newsgroup: alt.windows7.general

    Hello all,

    I'm currently calling a scripting objects function (which I'm in the process of writing) which should return a variable number of variables, meaning that the function receives a so-called "VarArray" (a SafeArray) to stuff those variables into.

    I tried using SafeArrayPutElement, but although I could see, in the
    function, the SafeArray was filled as expected, the script didn't show those results.

    Example (vbscript) :

    call GetData(out1,out2,out3 [,more output args])

    After some testing it turns out that the SafeArray the scripting objects function receives contains VT_BYREF elements, which SafeArrayPutElement doesn't resolve.

    IOW, It looks like SafeArrayPutElement just replaces the top element
    (VT_BYREF or not), not following the reference chain and altering the actual target.


    Question : Is there a way to tell SafeArrayPutElement to follow that
    reference chain first, or is there another function which does it (I've checked the oleaut32 header file and MSDN docs, but can't find anything like it).

    Remark: I've thrown a solution together by using SafeArrayPtrOfIndex and
    than resolving VT_BYREF elements manually, but "would have no problem" (understatement) (fur multiple reasons) to replace it with a build-in
    function - if it exists.

    Regards,
    Rudy Wieser


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From R.Wieser@address@is.invalid to comp.os.ms-windows.programmer.win32,alt.windows7.general on Mon Apr 27 17:07:53 2026
    From Newsgroup: alt.windows7.general

    I forgot to include the TypeLib definition :

    [vararg] HRESULT GetData([out] SAFEARRAY(VARIANT) VarArray);

    Regards,
    Rudy Wieser


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From lisa@not.in.use@home.invalid to alt.windows7.general on Tue Apr 28 09:51:22 2026
    From Newsgroup: alt.windows7.general

    On Mon, 27 Apr 2026 11:46:28 +0200, "R.Wieser" <address@is.invalid>
    wrote:

    I'm currently calling a scripting objects function (which I'm in the process >of writing)

    this is not a programming group!!!!!
    --
    "The day science begins to study non-physical phenomena, it will make more progress in one decade than in all the previous centuries of it's existence." Nikola Tesla
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From R.Wieser@address@is.invalid to alt.windows7.general on Tue Apr 28 11:19:26 2026
    From Newsgroup: alt.windows7.general

    Lisa,

    this is not a programming group!!!!!

    As long as you reject my choice of newsgroups without caring to why I made that choice(1) I'm going to ignore your bleating.

    'Cause thats all it is. The notorious "You can do it /anywhere else/, but
    not in my back yard" complaining (effectivily trying to make it some other newsgroups problem).

    - If you know a better group than do tell. It makes all kinds of sense to
    me to ask my questions in newsgroups where they have the largest chance of getting answered.

    - If you know the answer than do tell.

    Otherwise, shove off.

    (1) I could try to explain to you, but as you have already shown not to care and just tag more accusations to whatever I say that would be a wasted
    effort.

    (2) I've cross-posted into comp.os.ms-windows.programmer.win32 first, and
    here second. 'Cause the former is all but dead. Not that you care about that.

    Regards,
    Rudy Wieser


    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Frank Slootweg@this@ddress.is.invalid to alt.windows7.general on Tue Apr 28 10:10:19 2026
    From Newsgroup: alt.windows7.general

    lisa <not.in.use@home.invalid> wrote:
    On Mon, 27 Apr 2026 11:46:28 +0200, "R.Wieser" <address@is.invalid>
    wrote:

    I'm currently calling a scripting objects function (which I'm in the process
    of writing)

    this is not a programming group!!!!!

    Please do not cut off newsgroups! I have a filter for these kind of cross-posts, but you cutting of the (comp.os.ms-windows.programmer.win32)
    group makes me see your post.

    BTW, your signature is broken. the delimiter line should be
    dash-dash-space, i.e. a space at the end, but the space is missing.

    And while your at it, wrap the too long line at around 72 character boundaries.

    --
    "The day science begins to study non-physical phenomena, it will make more progress in one decade than in all the previous centuries of it's existence." Nikola Tesla
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Daniel70@daniel47@nomail.afraid.org to alt.windows7.general on Tue Apr 28 22:50:08 2026
    From Newsgroup: alt.windows7.general

    On 28/04/2026 8:10 pm, Frank Slootweg wrote:
    lisa <not.in.use@home.invalid> wrote:
    On Mon, 27 Apr 2026 11:46:28 +0200, "R.Wieser"
    <address@is.invalid> wrote:

    I'm currently calling a scripting objects function (which I'm in
    the process of writing)

    this is not a programming group!!!!!

    Please do not cut off newsgroups! I have a filter for these kind of cross-posts, but you cutting of the
    (comp.os.ms-windows.programmer.win32) group makes me see your post.

    Sorry. WHAT?? Do you filter all posts that are Cross-Posted anywhere
    (rather than just filtering cross-posts made to particular NGs)??
    --
    Daniel70
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Frank Slootweg@this@ddress.is.invalid to alt.windows7.general on Tue Apr 28 13:25:47 2026
    From Newsgroup: alt.windows7.general

    Daniel70 <daniel47@nomail.afraid.org> wrote:
    On 28/04/2026 8:10 pm, Frank Slootweg wrote:
    lisa <not.in.use@home.invalid> wrote:
    On Mon, 27 Apr 2026 11:46:28 +0200, "R.Wieser"
    <address@is.invalid> wrote:

    I'm currently calling a scripting objects function (which I'm in
    the process of writing)

    this is not a programming group!!!!!

    Please do not cut off newsgroups! I have a filter for these kind of cross-posts, but you cutting of the
    (comp.os.ms-windows.programmer.win32) group makes me see your post.

    Sorry. WHAT?? Do you filter all posts that are Cross-Posted anywhere
    (rather than just filtering cross-posts made to particular NGs)??

    Don't get your knickers in a twist! The latter, so in this case
    cross-posts between some particular groups (such as
    alt.windows7.general) and comp.os.ms-windows.programmer.win32
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Cut Cross Posting!@xPost.Scurge@invalid.invalid to alt.windows7.general on Tue Apr 28 16:51:50 2026
    From Newsgroup: alt.windows7.general

    On 28/04/2026 11:10, Frank Slootweg wrote:
    Please do not cut off newsgroups! I have a filter for these kind of cross-posts, but you cutting of the (comp.os.ms-windows.programmer.win32) group makes me see your post.


    Paganini doesn't allow cross-posting so there is no other way.



    --- Synchronet 3.21f-Linux NewsLink 1.2