OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Steve Swartz (steveswMICROSOFT.COM)
Date: Wed Oct 03 2001 - 13:03:20 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    It may be that you're running into the old "it's hard and/or impossible
    to truly turn off all services and make components run in the caller's
    context" problem. To see if that's so, store the following VBS into a
    file named noctx.vbs and then run the command "noctx.vbs ALL
    <APPLICATION NAME>" on the library application containing object3 and
    object4. This eliminates some services you might not even know about ;).
    Often this is what people are seeing when they say "there's context
    overhead in Windows 2000". They're comparing within-context calls in
    NT/MTS to cross-context calls in W2K/COM+.

    So far as I know, Tim Ewald's analysis is completely unsubstantiated. I
    have never seen evidence of even appreciable degradation of performance
    between NT/MTS and W2K/COM+ due to cross-context call performance, let
    alone the substantial degradation that you're seeing.

    <%

    Dim objArgs
    Set objArgs = WScript.Arguments

    SetApplicationProperty objArgs(1), "Base Application Partition",
    "Activation", 0 SetApplicationProperty objArgs(1), "Base Application
    Partition", "AccessChecksLevel", 0

    SetComponentProperty objArgs(0), objArgs(1), "Base Application
    Partition", "COMTIIntrinsics", 0 SetComponentProperty objArgs(0),
    objArgs(1), "Base Application Partition", "IISIntrinsics", 0
    SetComponentProperty objArgs(0), objArgs(1), "Base Application
    Partition", "JustInTimeActivation", 0 SetComponentProperty objArgs(0),
    objArgs(1), "Base Application Partition",
    "ComponentAccessChecksEnabled", 0 SetComponentProperty objArgs(0),
    objArgs(1), "Base Application Partition", "Synchronization", 0
    SetComponentProperty objArgs(0), objArgs(1), "Base Application
    Partition", "Transaction", 0 SetComponentProperty objArgs(0),
    objArgs(1), "Base Application Partition", "EventTrackingEnabled", 0
    SetComponentProperty objArgs(0), objArgs(1), "Base Application
    Partition", "MustRunInClientContext", 1

    '***********************************************************************
    *******
    ' Modifies a property value on an application
    '***********************************************************************
    *******
    Sub SetApplicationProperty (ApplicationName, PartitionName,
    PropertyName, PropertyValue)

            Set cat = CreateObject("COMAdmin.COMAdminCatalog.1")
            
            'cat.CurrentPartition = PartitionName
            Set collApps = cat.GetCollection("Applications")

            collApps.Populate
            
            numApps = collApps.Count
            For i = numApps - 1 To 0 Step -1
                If collApps.Item(i).Value("Name") = ApplicationName Then
                    collApps.Item(i).Value(PropertyName) = PropertyValue
                End If
            Next
            
            collApps.SaveChanges

            Set collApps = Nothing
            Set cat = Nothing

    End Sub

    '***********************************************************************
    *******
    ' Set a component property
    '***********************************************************************
    *******
    Sub SetComponentProperty (ComponentID, ApplicationName, PartitionName,
    PropertyName, PropertyValue)

            Set cat = CreateObject("COMAdmin.COMAdminCatalog.1")
            
            'cat.CurrentPartition = PartitionName
            Set collApps = cat.GetCollection("Applications")

            collApps.Populate
            
            numApps = collApps.Count
            For i = numApps - 1 To 0 Step -1
                If collApps.Item(i).Value("Name") = ApplicationName Then

                            Set collComponents =
    collApps.GetCollection("Components", collApps.Item(i).Key)
                            collComponents.Populate
                            
                            numComponents = collComponents.Count

                            For j = numComponents - 1 To 0 Step -1

                                'If collComponents.Item(j).Value("CLSID") =
    ComponentID Then
            
    collComponents.Item(j).Value(PropertyName) = PropertyValue
                                    'End If
                            
                            Next

                            collComponents.SaveChanges

                End If
            Next
            
            collApps.SaveChanges

            Set collComponents = Nothing
            Set collApps = Nothing
            Set cat = Nothing

    End Sub

    %>

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM