Microsoft KB Archive/277984

= PRB: COMAdminCatalog::InstallMultipleComponents Method Fails in VBScript =

Article ID: 277984

Article Last Modified on 5/28/2003

-

APPLIES TO

 Microsoft COM+ 1.0, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows XP Professional  Microsoft COM+ 1.5, when used with:  Microsoft Windows 2000 Standard Edition

 Microsoft Windows XP Professional</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q277984

<div class="symptoms_section">

SYMPTOMS
The COM+ COMAdminCatalog::InstallMultipleComponents method that works under Microsoft Visual Basic fails under Visual Basic Scripting Edition (VBScript) with a type mismatch error.

<div class="cause_section">

CAUSE
The call to InstallMultipleComponents fails because this method takes parameters of the form SafeArray(Variant)*. However, for this method to work in VBScript, the parameters are passed as Variant *.

<div class="moreinformation_section">

MORE INFORMATION
The following code adds multiple components to a COM+ application when it is called from Visual Basic but fails in VBScript with a type mismatch error: Set objAdminCat = CreateObject (&quot;COMAdmin.COMAdminCatalog&quot;) Dim rgFiles(1) Dim rgCLSID(1) rgFiles(0) = &quot;Q277984.dll&quot; rgFiles(1) =

rgCLSID(0) = &quot;{44DAAEC9-F383-42CC-BA1A-8F3A036B0DAE}&quot; rgCLSID(1) = &quot;{DB2E2C08-2285-4105-925E-B7ECBA8C6C5D}&quot;

cat.InstallMultipleComponents &quot;Q277984&quot;, rgFiles, rgCLSID NOTE: The preceding code sample assumes that a COM+ application named Q277984 is already installed.

To call InstallMultipleComponents from VBScript, use the following code sample: Dim cat

Set cat = CreateObject(&quot;COMAdmin.COMAdminCatalog&quot;)

'The following line works in VBScript. cat.InstallMultipleComponents &quot;Q277984&quot;,Array(&quot;Q277984.dll&quot;,&quot;Q277984b.dll&quot;), Array(&quot;{44DAAEC9-F383-42CC-BA1A-8F3A036B0DAE}&quot;, &quot;{DB2E2C08-2285-4105-925E-B7ECBA8C6C5D}&quot;)

Set cat = Nothing

Keywords: kbcode kbprb KB277984

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.