🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5303

Re: Help with SAFEARRAY

#5303
From: Remy Lebeau (TeamB)
Date: Fri, 16 Sep 2005 02:18
33 lines
1990 bytes
"LarryJ" <LarryJ33@ev1.net> wrote in message
news:432a15a0@newsgroups.borland.com...

>  pArray = AllocateArray( VT_BSTR );
>  pLongArray = AllocateArray( VT_I4 );

You did not show what AllocateArray() is doing, nor did you specify what
GetSymbols() expects as input, so there is no real way to tell you exactly
how the SAFEARRAYs should be initialized for your situation.  I can only
assume that AllocateArray() is allocating a 1-dimension array, ie:

    SAFEARRRAYBOUND bound = {0};
    bounds.lElements = 0;
    bounds.lLbound = 0;

    LPSAFEARRAY pSymbols = ::SafeArrayCreate(VT_BSTR, 1, &bound);
    if( pSymbols )
    {
        LPSAFEARRAY pNumbers = ::SafeArrayCreate(VT_I4, 1, &bound);
        if( pNumbers )
        {
            if( SUCCEEDED(GetSymbols(pSymbols, pNumbers)) )
            {
                // use pSymbols and pNumbers as needed...
            }
            ::SafeArrayDestroy(pNumbers);
        }
        ::SafeArrayDestroy(pSymbols);
    }


Gambit
Technical Details
Message-ID: <432a2b61$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <4329d38a@newsgroups.borland.com> <4329da90$1@newsgroups.borland.com> <432a15a0@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d0eb3921b71e7751
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <4329d38a@newsgroups.borland.com> <4329da90$1@newsgroups.borland.com> <432a15a0@newsgroups.borland.com>
Subject: Re: Help with SAFEARRAY
Date: Thu, 15 Sep 2005 19:18:13 -0700
Lines: 35
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <432a2b61$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1126837089 68.69.17.41 (15 Sep 2005 19:18:09 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail