⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 Com++的例子程序
💻 TXT
字号:
Programmatic administration of COM+ Applications with the COM+ Admin objects in VC++

Ranjeet Chakraborty.
ranjeetc@hotmail.com

Environment: [VC++ 6.0, VB 6.0, Windows 2000]


I started exploring programmatic administration of COM+ applications when we came across the requirement of changing the component抯 constructor string via an MMC snapin as well as allow the flexibility to add a predetermined set of roles and allocate users to them at one shot via some installation script.  
The project involved a typical WinDNA application with COM+ components holding the business logic in the middle tier. A setup application installed the COM+ application with the components and all their attributes.  
Typically every com+ application has the following configurable parameters of which some could be set through the component services tool and some can抰 :  
For details refer MSDN/ Platform SDK/Component Services/COM+/Reference/COM+ Administrator抯 Reference  
AccessChecksLevel, Activation, ApplicationAccessChecksEnabled, ApplicationProxy, ApplicationProxyServerName, Authentication, AuthenticationCapability, Changeable, CommandLine, CreatedBy, CRMEnabled, CRMLogFile, Deleteable, Description, EventsEnabled, ID, ImpersonationLevel, Identity, IsSystem, Name, Password, QueuingEnabled, QueueListenerEnabled, RunForever, ShutdownAfter, 3GigSupportEnabled . 

For individual Components in the application following parameters are configured:  
AllowInprocSubscribers, ApplicationID, CLSID, ComponentAccessChecksEnabled, COMTIIntrinsics, ConstructionEnabled, ConstructorString, CreationTimeout, Description, DLL, EventTrackingEnabled, ExceptionClass, FireInParallel, IISIntrinsics, IsEventClass, JustInTimeActivation, LoadBalancingSupported, MaxPoolSize, MinPoolSize, MultiInterfacePublisherFilterCLSID, MustRunInClientContext, ObjectPoolingEnabled, ProgID, PublisherID, Synchronization, ThreadingModel,Transaction, VersionBuild, VersionMajor, VersionMinor, VersionSubBuild. 

The complete list for other related collections like Roles, RolesForComponent, etc could be found in the Platform Sdk doc.  
A programmatic approach to configure all the above parameters is provided via the com+ administration objects.  
The administration objects provide a way to access and manipulate all of the COM+ configuration data otherwise accessible through the Component Services administration tool. You can use these objects to automate all tasks in COM+ administration. These admin objects let us read and write information stored on the COM+ catalog, the underlying data store that holds all COM+ configuration data.  
Throughout MSDN and the platform SDK there was no sample code available for VC++ developers (at least I couldn抰 find any) So I decided to write one.  
Visual studio doesn抰 come with the header files or IDL files for COMAdmin.dll. So it isn抰 as easy as including the header file in your project and getting to work with CoCreateInstance for the appropriate interface on the appropriate coclass.  
The COM+ 1.0 Type Library in OLEVIEW looks something like this. 






What I found was that The COM+ admin objects consists of three components(coclasses in idl). Each of them having one main dispinterface as the default interface(as each coclass implemented one interface only). For example the coclass COMAdminCatalog implemented one interface ICOMAdminCatalog. 

            coclass COMAdminCatalog {  
                        [default] interface ICOMAdminCatalog; 
            }; 

This component represents the COM+ Catalog Manager.  
The reason I guess these components exposed dispinterfaces were because they needed to be accessed via installation scripts run under WSH or through VB.  
Talking more about the objects, There are logical collections such as Applications, Components and Roles which map to COMAdminCatalogCollection component.Similarly logical collections like Application, Component and Role map to the COMAdminCatalogObject component.The COMAdminCatalog stands as the root object and it contains the Applications Collection.The Roles and the Components collection could be retrieved from the Applications collection. Similarly the other collections specific to a component say "RolesForComponent" could be retrieved from the Components collection.  
Did I hear 憏ukss

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -