Simple instructions on how to perform basic tasks with COM and ActiveX controls.
DCOM with smart pointers (Remote Launch)
Use this method to instantiate a COM object on a Remote machine.
COM with smart pointers (Used across several functions)
Use this method to instantiate a COM object without having to call CoCreateInstance. It also allows the COM object to be declared in the class declaration and created in InitialDialog() or simular, then used throughout the class.
COM with smart pointers (Within single function)
Use this method to instanciate a COM object without having to call CoCreateInstance. This is suitable only if the object is created and destroyed withing the same function.
Using the XPath notation to locate data in an XML document.
XPath is like the fully qualified path to a file in a directory except it it points to a piece of data in a XML document. It is very useful for extracting data with predefined descriptors in the document.
How to create and parse a simple XML document using MSXML.dll
Most developers would be able to create and even parse an XML packet using simple string manupulation. Hovever the MSXML DOM make the task trival and enable the development, manipulation and parsing of very complex XML documents.
Interogating an object through Idispatch
Here is a small segement of code that can be used to enumerate the methods of a IDispatch interface. This can be useful when little is known about the interface.
Handling event in an embedded web broswer control.
A web browser is a powerful tool when embedded in you’re application. This article covers how to catch keyboard and other events in CHtmlView, CHtmlCtrl and Microsoft Web Browser Control.
Reading from an MS Access database using ADO.
ADO is currently flavour of the year for accessing databases. This article provides a simple example of how to read from a MS Access database using ADO.
How to create a Persistent Property in an ActiveX control.
This article discusses creating a Persistent property in an ActiveX control that can be modified in IDE such as VB, Delphi and Visual Studio.NET.
How to work with BSTR
When passing strings to and from COM objects BSTRs are used. This article covers when to allocate, reallocate and free the BSTR.
Using the simple CoCreateInstance function to instanciate a COM object.
The CoCreateInstance function provides the most basic method of Instanciating a COM object. It is also capable of encouraging the object to be instanciated on a remote machine without to much trouble.
Creating a Simple callback function in VC and VB.
Callbacks are quite simple when done within the same process, however when calling across process boundrys or machines another system must be used. This is done using COM in a simular way to ActiveX events.