OLE Automation - passing arrays
Mark Worrall -- MarkWorrall@compuserve.com Sunday, March 09, 1997 Whats the best way to pass an array of string from an Automation Server back to the controller. The array will have a differing number of elements to pass back each time. thanks, Mark Environment:
Hemanta Banerjee -- hemantab@indus.hclt.com Tuesday, March 11, 1997 [Mini-digest: 6 responses] Hi, > > Whats the best way to pass an array of string from an Automation Server > back to the controller. The array will have a differing number of elements > to pass back each time. > > thanks, > Mark > > Environment:> Pass it as a collection object, u can lookup Kraig B's book on how to implement enumerations. Thanks & Regards, Hemanta Banerjee. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Office :- Residence :- HCL Technologies Limited, #17, Sriramnagar 1st Cross, 50-53 Greams Road, Thiruvanmiyur, Madras - 600 0006. Madras - 600 041. Ph :- (91)-(44)-8279140,8279312 (91)-(44)-4913160 PP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----From: Mike Blaszczak At 00:55 3/9/97 -0500, Mark Worrall wrote: >Whats the best way to pass an array of string from an Automation Server >back to the controller. The array will have a differing number of elements >to pass back each time. Use a safearray. They're very, very well-documented. .B ekiM http://www.nwlink.com/~mikeblas/ These words are my own. I do not speak on behalf of Microsoft. This performance was not lip-synched. -----From: Regis NICOLAS At 12:55 AM 3/9/97 -0500, you wrote: >Whats the best way to pass an array of string from an Automation Server >back to the controller. The array will have a differing number of elements >to pass back each time. > >thanks, >Mark > >Environment: > > Check the KB: SAMPLE MFCARRAY and SAFEARRAY. You can reach them by a search on VC++ Books keywords: OLE Array Hope this helps... Regis ------------------------------ Regis NICOLAS - R&D Windows Smartcode Technologie mailto:nicolas@smartcode.fr http://www.smartcode.fr/ http://www.smartcodesoft.com/ Tel.: (33) (0)4 67 59 30 16 -----From: Cuong Nguyen Mark Worrall wrote: > > Whats the best way to pass an array of string from an Automation Server > back to the controller. The array will have a differing number of elements > to pass back each time. > > thanks, > Mark > > Environment: Use VARIANT of BSTR... Cuong -----From: "Doug Brubacher" I keep answering variations of this same question on this list. Trying using a safe array which can be passed as a Variant automation type. In your case you want a variant type of VT_BSTR | VT_ARRAY. Assign your safearray to a variant as follows: VariantInit( &vInfoArray ); V_VT( &vInfoArray) = VT_ARRAY | VT_BSTR; V_ARRAY( &vInfoArray) = psaInfoArray; You can use array manipulation APIs like: SafeArrayGetDim(psaInfoArray) SafeArrayGetLBound(psaInfoArray, 1, &lLBound) SafeArrayGetUBound(psaInfoArray, 1, &lUBound) to determine the additional information you need in the calling application. Regards, Doug Brubacher Doug_Brubacher@compuware.com -----From: "Perkins, Rudi" Look in MSDN (or VC++ help for that matter) for "MFCARRAY". It is a sample that uses arrays a bunch of different ways from an MFC OLE Automation Server. The sample works fine from VB4.0 but I have been unable to get it to work from VBScript in an ASP page on IIS. If you are working with VBScript and get this working, please let me know. Rudi rudip@restrac.com ---------- From: owner-mfc-l Sent: Sunday, March 09, 1997 12:55 AM To: mfc-l Subject: OLE Automation - passing arrays Whats the best way to pass an array of string from an Automation Server back to the controller. The array will have a differing number of elements to pass back each time. thanks, Mark Environment:
Rajesh Parikh -- rparikh@usa.net Saturday, March 15, 1997 [Mini-digest: 2 responses] Use SafeArray data type to accomplish this... Rajesh Parikh Mark Worrall wrote: > > Whats the best way to pass an array of string from an Automation Server > back to the controller. The array will have a differing number of elements > to pass back each time. > > thanks, > Mark > > Environment:-----From: Keith Vasilakes > > ---------- > From: owner-mfc-l > Sent: Sunday, March 09, 1997 12:55 AM > To: mfc-l > Subject: OLE Automation - passing arrays > > Whats the best way to pass an array of string from an Automation Server > back to the controller. The array will have a differing number of > elements > to pass back each time. > > thanks, > Mark > > Environment: Check out this idea, I use it and it works quite well. http://www.vcdj.com/vcdj/nov96/ole.htm Keith V
Become an MFC-L member | Вернуться в корень Архива |