Summary: AUTOCTRL demonstrates how to create an OLE automation controller. More Information: This OLE automation controller sample demonstrates how to create an OLE automation object and how to access it's properties and methods. Creating an Automation Object: (See CreateObject() in autoctrl.cpp) ----------------------------- The user is prompted for the ProgID of the automation object to be created. CLSIDFromProgID is used to obtain the CLSID of the object and CoCreateInstance is used to create the object. Accessing Properties and Methods: --------------------------------- IDispatch::GetIDsOfNames is used to obtain the ID of the property or method to be accessed and IDispatch::Invoke is used to access the property or method. This controller prompts the user for the locale ID. However, many controllers like Visual Basic will use the default system locale ID. Setting a property: (See SetProperty() in autoctrl.cpp) ------------------- The user is prompted for the property name, property value, property type and locale id. This controller supports three types - VT_BSTR, VT_I2 and VT_R4. Setting the property requires an implicit named parameter which represents the new value of the property. The DISPID of this implicit named parameter is DISPID_PROPERTYPUT. Getting a property: (See GetProperty() in autoctrl.cpp) ------------------- The user is prompted for the property name, property type and locale id. Invoking a method: (See InvokeMethod() in autoctrl.cpp) ------------------ The user is prompted for the method name and the locale id. This controller only supports methods without parameters. Limitations: ----------- This contoller implementation has the following limitations to keep the code simple: 1. Does not handle indexed properties or methods with parameters. 2. Can set only VT_BSTR, VT_I2 and VT_R4 values to properties. Source Files: ------------ AUTOCTRL.CPP Does initialization, creates main window, contains message pump and contains code to create an automation object and access it's properties and methods. DLGFUNCS.CPP Contains the dialog functions for the dialogs that prompt the user for input and the error reporting function.