Well, it actually seems I don't have to. I just pass the & of the CComBSTR and it works fine....
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Ehsan Akhgari > Sent: 29 September 2005 14:48 > To: [email protected] > Subject: Re: [msvc] BSTR variables > > > Truckle, Andrew J wrote: > >>I believe you need to declare an array of BSTRs, and pass the > >>pointer of that array to the method. I'm not entirely sure > >>whether an array of CComBSTRs would be any good - depends if > >>they're a thin wrapper around BSTR (like CRect is around > >>RECT, CPoint around POINT, etc.) or whether they are more > >>cumbersome. You might find it safer to declare (literally) > >>BSTR strings[40] and pass 'strings', and then when it returns > >>assign each entry to a CComBSTR to get back your safety. > > > > > > But that implies needing to know the number of categories > before hand > > when creating the array. > > Yes, you do. If the method took a BSTR **, then you could > pass a pointer to a BSTR * which would then get allocated by > the callee which knows the number of items in the array, but > with the current situation, you need to figure out how to > find the number of items in the array. > > -- > Ehsan Akhgari > Farda Technology <http://www.farda-tech.com/> > > In C we had to code our own bugs. In C++ we can inherit them. > > > _______________________________________________ > msvc mailing list > [email protected] > See > http://beginthread.com/mailman/listinfo/msvc_beginthread.com > for subscription changes, and list archive. > > > This message has been scanned for viruses by MailControl - > (see http://bluepages.wsatkins.co.uk/?4318150) > This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding. _______________________________________________ msvc mailing list [email protected] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
