Initializing COM and Vehicle I/O

Because the vehicle I/O API is a COM interface, when you write an application, you must first initialize COM and then initialize the vehicle I/O interface. The following code example, shows how to initialize and uninitialize COM and vehicle I/O.

// Initialize COM.
CoInitializeEx(NULL, COINIT_MULTITHREADED);
// Initialize the vehicle I/O interface.
// This initializes any necessary driver structures.
VIOInitialize(NULL);

// The rest of your Auto PC application goes here.
.
.
.
// The application is now complete.

VIOUninitialize();
CoUninitialize();