// MultiView.odl : type library source for OLE Control project. // This file will be processed by the Make Type Library (mktyplib) tool to // produce the type library (MultiView.tlb) that will become a resource in // MultiView.ocx. // *************************************************************************** // // Copyright (c) 1997-1999 Microsoft Corporation // // File: MultiView.odl // // Description: // This file contains the ODL for the Class Explorer ActiveX control. // // Part of: // MultiView.ocx // // History: // Judith Ann Powell 10-08-96 Created. // // Primary dispatch interface for CMultiViewCtrl // // Properties: // // NameSpace - BSTR Set will change the namespace // // Methods: // // void ViewClassInstances(BSTR lpszClassName) // // Get instance enumeration of the classes instances and display the // instances. // // Parameters: // BSTR lpszClassName [IN] Path to class to view. // // Returns: // Nothing. // // void ForceRedraw() // // Invoke the controls InvalidateControl member function. // // void CreateInstance() // // Not implemented. // // DeleteInstance // // This method deletes the currently selected instance. // // Parameters: // None. // // Returns: // E_NOTIMPL // // GetContext // // Take a snapshot of the current state of the control, // save the state in a context object and return a handle to the // context object. The intial reference count to the context object // will be one. The context object will be deleted when its reference // count is decremented to zero. // // Parameters: // [out] long FAR* plCtxtHandle // This is a pointer to the place to return the context // handle. // // Returns: // long // S_OK if the context was returned successfully, E_FAIL // if not. // // RestoreContext // // Restore the state of this SingleView control to the previously saved // context. // // Parameters: // long lCtxtHandle // This is the handle of the context to restore to. // // Returns: // long // S_OK if the view's context could be restored, a failure code // otherwise. // // AddContextRef // // Increment the reference count for the specified context handle. // // Parameters: // [out] long lCtxtHandle // The context handle. // // Returns: // long // S_OK if the reference count was successfully incremented, // a failure code otherwise. // // ReleaseContext // // Decrement the reference count for the specified context handle. // // Parameters: // [out] long lCtxtHandle // The context handle. // // Returns: // long // S_OK if the reference count was successfully decremented, // a failure code otherwise. // // // GetEditMode // // Get the current state of the edit mode flag. // // Parameters: // None. // // Returns: // long TRUE if in edit mode, otherwise FALSE // // GetObjectPath // // Get the object path at the given object position. // // Parameters: // [in] long lPosition // One of the following: // 0 = Current object // 1 = First object // 2 = Last object // // Returns: // BSTR // The specified object path, or NULL if no object // exists at the given position. // // GetObjectTitle // // Get a title for the specified object that is suitable for display // to the user. Note that the title is not necessarily the object path. // // Parameters: // [in] long lWhere // 0 = Currently selected object. // Returns: // BSTR // The object's title. // // GetTitle // // The container calls this method to get the title and icon to // display in the title bar. // // Parameters: // [out] BSTR FAR* pbstrTitle // Pointer to the place to return the view's title. // // [out] LPDISPATCH FAR* lpdispPicture // The picture dispatch pointer for the title bar icon to // be displayed. NULL if no icon should be displayed. // // Returns: // long // S_OK if the title and icon were returned successfully, // E_FAIL otherwise. // // GetViewTitle // // Returns an empty string. // // arameters: // [in] long lPosition // 0 = The default view. // 1 = The currently selected view. // 2 = The first view. // 3 = The last view. // // Returns: // BSTR // An empty string.. // // NextViewTitle // // Get the title of the view at the next position. Only returns -1. // // Parameters: // [in] long lPosition // The view position. The initial value of lPosition is // obtained by calling StartViewEnumeration. // // [out] BSTR FAR* pbstrTitle // The view title is returned here. // // Returns: // long // -1 // // ExternInstanceCreated // // The container calls this method when it creates an new WMI object // instance. // // Parameters: // [in] BSTR szObjectPath // The WBEM object path for the newly created instance. // // Returns: // Nothing. // // ExternInstanceDeleted // // The container calls this method when it deletes a WMI object // instance. // // Parameters: // [in] BSTR szObjectPath // The WMI object path for the newly created instance. // // Returns: // Nothing. // // NotifyWillShow // // This method is defunct and will be removed from the API. // // Parameters: // None. // // Returns: // Nothing. // // PrevViewTitle // // Get the title of the view at the previous position. Only returns -1. // // Parameters: // [in] long lPosition // The view position. The initial value of lPosition is obtained // by calling StartViewEnumeration. // // [out] BSTR FAR* pbstrTitle // The view title is returned here. // // Returns: // long // -1 // // QueryCanCreateInstance // // Returns FALSE. Makes no sense for the Multiview control. // // Parameters: // None. // // Returns: // long // FALSE // // QueryCanDeleteInstance // // Call this method to determine whether or not it is OK to call "DeleteInstance" to // delete the current instance. This method will return FALSE if there is no current // instance to delete, etc. // // Parameters: // None. // // Returns: // long // TRUE if the current instance can be deleted, FALSE if there is // no current instance or it can't be deleted. // // QueryNeedsSave // // Returns FALSE. Makes no sense for the Multiview control. // // Parameters: // None. // // Returns: // long // FALSE // // QueryObjectSelected // // Check to see whether or not the object has a selection. // // Parameters: // None. // // Returns: // long // TRUE if an object is currently selected, FALSE otherwise. // // RefreshView // // This method causes the contents of the view to be re-loaded from // the database. // // Parameters: // None. // // Returns: // long // S_OK if successful, a failure code if some error occurred. // // SaveData // // Not implemented. // // Parameters: // None. // // Returns: // E_NOTIMPL // // SelectView // // Not implemented. // // Parameters: // None. // // Returns: // E_FAIL // // SetEditMode // // Set the view's edit mode flag. // // Parameters: // [in] long bCanEdit // TRUE if the data in the view can be edited. FALSE // if the data should not be edited (browse mode only). // // Returns: // Nothing. // // StartObjectEnumeration // // Start enumeration of objects. // // Parameters: // [in] long lWhere // 0 = Currently selected object. // Returns: // long // S_OK if the object selection was successful. // // StartViewEnumeration // // Start the enumeration of alternate (custom) views. Returns only -1. // // Parameters: // [in] long lWhere // 0 = The default view. // 1 = The currently selected view. // 2 = The first view. // 3 = The last view. // // Returns: // long // -1 = There are not alternative views. // // void ViewInstances(VARIANT psaPaths) // // Displays the instances in the varPathArray argument. The // first element in the array can be a class name or empty. It // is ignored. This method is also currently not used by any other // components. // // Parameters: // [in] BSTR szTitle // The view title. // // [in] VARIANT varPathArray // Variant array of BSTR's. First element should ba a class // or empty. It is not used. // // Returns: // Nothing // // void QueryViewInstances // // Displays the instances returned by the query. // // Parameters: // BSTR pLabel [IN], Label for display purposes // BSTR pQueryType [IN], WQL or SQL // BSTR pQuery [IN], Query // BSTR pClass [IN] Optional, result class // // Returns: // Nothing // // NextObject // // Get the position of the next object in the currently selected view. // // Parameters: // [in] long lPosition // The position value returned by StartObjectEnumeration, // PrevObject, or NextObject. // // Returns: // long // The position of the next object. // // PrevObject // // Get the position of the previous object in the currently selected view. // // Paramters: // [in] lPosition // The position value returned by StartObjectEnumeration, // PrevObject, or NextObject. // // Returns: // long // The positon of the previous object. // // SelectObjectByPath // // Select the specified object. // // Parameters: // [in] LPCTSTR szObjectPath // The WMI object path. // // Returns: // S_OK if the object is selected, a failure code // otherwise. // // SelectObjectByPosition // // Select object by position. // // Parameters: // [in] long lPos // The object position. // // Returns: // long // S_OK if the object was selected successfully, a failure code // otherwise. // // Event dispatch interface for CMultiViewCtrl // // NotifyViewModified // // Not fired. // // Parameters: // None. // // Returns: // Nothing. // // NotifySelectionChanged // // Fired when an object is selected. // // Parameters: // None. // // Returns: // Nothing. // // NotifySaveRequired // // Not fired. // // Parameters: // None. // // Returns: // Nothing. // // NotifyViewObjectSelected // // Fired when as object is double clicked. // // Parameters: // BSTR szObjectPath [OUT] path of selected object. // // Returns: // Nothing. // // void GetIWbemServices // // Fired when the control wants to connect to a namespace. // // Parameters: // BSTR lpctstrNamespace [IN], Namespace to connect to // VARIANT* pvarUpdatePointer [IN], Tells dll to get new pointer // VARIANT* pvarServices [IN/OUT], Services pointer returned // VARIANT* pvarSC [IN/OUT], S_OK on success or failure code // VARIANT* pvarUserCancel [IN/OUT]) Tells the control if user canceled // // Returns: // Nothing. // // NotifyContextChanged // // Not fired. // // Parameters: // None. // // Returns: // Nothing. // // ************************************************************************** #include #include [ uuid(FF371BF1-213D-11D0-95F3-00C04FD9B15B), version(1.0), helpstring("WMI Multiple Instances Viewer"), control ] library MULTIVIEWLib { importlib(STDOLE_TLB); importlib(STDTYPE_TLB); // Primary dispatch interface for CMultiViewCtrl [ uuid(FF371BF2-213D-11D0-95F3-00C04FD9B15B), helpstring("Dispatch interface for WMI Multiple Instances Viewer"), hidden ] dispinterface _DMultiView { properties: // NOTE - ClassWizard will maintain property information here. // Use extreme caution when editing this section. //{{AFX_ODL_PROP(CMultiViewCtrl) [id(1), helpstring("Current Namespace")] BSTR NameSpace; [id(2), helpstring("All Properties or Display Subset")] long PropertyFilter; //}}AFX_ODL_PROP methods: // NOTE - ClassWizard will maintain method information here. // Use extreme caution when editing this section. //{{AFX_ODL_METHOD(CMultiViewCtrl) [id(3), helpstring("Enumerate and Display Instances")] void ViewClassInstances(BSTR lpszClassName); [id(4), helpstring("Redraw")] void ForceRedraw(); [id(5), helpstring("Create and Select Instance")] long CreateInstance(); [id(6), helpstring("Delete Instance")] long DeleteInstance(); [id(7), helpstring("Save Control State and Return Context")] long GetContext(long* pCtxHandle); [id(8), helpstring("Restore Control State from Context")] long RestoreContext(long lCtxtHandle); [id(9), helpstring("Increment Context Ref Count")] long AddContextRef(long lCtxtHandle); [id(10), helpstring("Decrement Context Ref Count")] long ReleaseContext(long lCtxtHandle); [id(11), helpstring("Get Read or Modify State")] long GetEditMode(); [id(12), helpstring("Get Path of Selected Object")] BSTR GetObjectPath(long lPosition); [id(13), helpstring("Get Title of Selected Object")] BSTR GetObjectTitle(long lPosition); [id(14), helpstring("Get View Title and Icon")] long GetTitle(BSTR* pbstrTitle, IDispatch** lpPictDisp); [id(15), helpstring("Get Current View Title")] BSTR GetViewTitle(long lPosition); [id(16), helpstring("Get Next View Title")] long NextViewTitle(long lPosition, BSTR* pbstrTitle); [id(17), helpstring("WMI Object Created")] void ExternInstanceCreated(BSTR szObjectPath); [id(18), helpstring("WMI Object Deleted")] void ExternInstanceDeleted(BSTR szObjectPath); [id(19), helpstring("Prepare to View")] void NotifyWillShow(); [id(20), helpstring("Title of View at Previous Position")] long PrevViewTitle(long lPosition, BSTR* pbstrTitle); [id(21), helpstring("Can Instance be Created")] long QueryCanCreateInstance(); [id(22), helpstring("Can Instance be Deleted")] long QueryCanDeleteInstance(); [id(23), helpstring("Is Current Object Modified")] long QueryNeedsSave(); [id(24), helpstring("Is Current Object Selected")] long QueryObjectSelected(); [id(25), helpstring("Redraw from Repository")] long RefreshView(); [id(26), helpstring("Save Changes to Current Object")] long SaveData(); [id(27), helpstring("Current Position of the View")] long SelectView(long lPosition); [id(28), helpstring("Set Read or Modify State")] void SetEditMode(long bCanEdit); [id(29), helpstring("Start Enumeration of Objects")] long StartObjectEnumeration(long lWhere); [id(30), helpstring("Start Enumeration of Views")] long StartViewEnumeration(long lWhere); [id(31), helpstring("Display Instances")] long ViewInstances(BSTR szTitle, VARIANT varPathArray); [id(32), helpstring("Display Query Results")] void QueryViewInstances(BSTR szTitle, BSTR szQueryType, BSTR szQuery, BSTR szClass); [id(33), helpstring("Position of Next Object in Current View")] long NextObject(long lPosition); [id(34), helpstring("Position of Previous Object in Current View")] long PrevObject(long lPosition); [id(35), helpstring("Select Specified Object by Path")] long SelectObjectByPath(BSTR szObjectPath); [id(36), helpstring("Select Specified Object by Position")] long SelectObjectByPosition(long lPosition); //}}AFX_ODL_METHOD [id(DISPID_ABOUTBOX)] void AboutBox(); }; // Event dispatch interface for CMultiViewCtrl [ uuid(FF371BF3-213D-11D0-95F3-00C04FD9B15B), helpstring("Event interface for WMI Multiple Instances Viewer") ] dispinterface _DMultiViewEvents { properties: // Event interface has no properties methods: // NOTE - ClassWizard will maintain event information here. // Use extreme caution when editing this section. //{{AFX_ODL_EVENT(CMultiViewCtrl) [id(1), helpstring("View has Changed State")] void NotifyViewModified(); [id(2), helpstring("New Selection in Custom View")] void NotifySelectionChanged(); [id(3), helpstring("Object has been Modified")] void NotifySaveRequired(); [id(4), helpstring("Object Selected")] void NotifyViewObjectSelected(BSTR szObjectPath); [id(5), helpstring("Get IWbemServices Pointer Request")] void GetWbemServices(BSTR szNamespace, VARIANT* pvarUpdatePointer, VARIANT* pvarServices, VARIANT* pvarSc, VARIANT* pvarUserCancel); [id(6), helpstring("Current Context has Changed")] void NotifyContextChanged(long bPushContext); [id(7), helpstring("Request to Become UI Active")] void RequestUIActive(); //}}AFX_ODL_EVENT }; // Class information for CMultiViewCtrl [ uuid(FF371BF4-213D-11D0-95F3-00C04FD9B15B), helpstring("WMI Multiple Instances Viewer"), control ] coclass MultipleInstanceViewer { [default] dispinterface _DMultiView; [default, source] dispinterface _DMultiViewEvents; }; //{{AFX_APPEND_ODL}} };