Microsoft KB Archive/305765

= PRB: ICOMAdminCatalog2::PauseApplicationInstances Returns S_OK for Applications That Are Not Running =

Article ID: 305765

Article Last Modified on 12/5/2007

-

APPLIES TO


 * Microsoft COM+ 1.5

-



This article was previously published under Q305765



SYMPTOMS
The ICOMAdminCatalog2::PauseApplicationInstances method returns S_OK for applications that are not running instead of COMADMIN_E_APP_NOT_RUNNING.



RESOLUTION
To resolve this problem, pass an empty ApplicationInstances collection to PauseApplicationInstances. In this scenario, PauseApplicationInstances successfully pauses all zero elements and returns without error.



STATUS
This behavior is by design.



MORE INFORMATION
The following code reproduces this problem when you update the call if (objApplications.Item(lIndex).Value('Name') == 'MyApplication') so that it points to the name of one of your applications. var objComAdmin = null; var objApplications = null; var objApplication = null; var objAppInst = null;

objComAdmin = new ActiveXObject('ComAdmin.ComAdminCatalog');

objApplications = objComAdmin.GetCollection('Applications'); objApplications.Populate;

WScript.Echo(objApplications.Count);

for (lIndex = 0; lIndex < objApplications.Count; ++lIndex) { if (objApplications.Item(lIndex).Value('Name') == 'MyApplication') {   objApplication = objApplications.Item(lIndex); objAppInst = objApplications.GetCollection('ApplicationInstances', objApplication.Key)

if (objAppInst == null) WScript.Echo(&quot;No application instances&quot;); else {     objAppInst.Populate; WScript.Echo(&quot;There are &quot; + objAppInst.Count + &quot; instances&quot;); }

try {     objComAdmin.PauseApplicationInstances(objAppInst); }   catch(ex) {     WScript.Echo(&quot;Error!&quot;); }

WScript.Echo(&quot;OK&quot;); WScript.Quit(0); } }

Additional query words: not-running

Keywords: kbsysadmin kbprb KB305765

-

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

© Microsoft Corporation. All rights reserved.