There are some features of Coverage Validator that are useful to call directly from your program.
If you are working with services you to attach Coverage Validator to a service and to start Coverage Validator, you should use the NT Service API, not the functions in this API.
All the other functions in this API can be used with applications and with services.
All the API functions are provided in Unicode and ANSI variants where strings are used. We've also provided a character width neutral #define in the same fashion that the Windows.h header files do.
For example a function might be provided as functionA(), functionW() with the character width neutral function() mapping to functionW() for unicode and functionA() for ANSI.
In this document we're going to use TCHAR like the Window.h header files do.
You can use the API without incurring any dependency on Coverage Validator.
If Coverage Validator is not installed on the machine the software runs on, nothing will happen.
This allows you to add the Coverage Validator API to your software without need to have a separate build for use with Coverage Validator.
For most use cases won't need to load the profiler, as the profiler will have been loaded when your launched your program from Coverage Validator, or when you injected into your program using Inject or Wait For Application.
However if you're running your program from outside of Coverage Validator and want to load the profiler from inside your program you can use cvLoadProfiler() to do that. You'll then need to call cvStartProfiler() to start it.
To start the profiler from your API code you need to call the function cvStartProfiler() from your code before you call any API functions. Ideally you should call this function as early in your program as possible.
If you prefer to start the profiler from the user interface or command line you can omit the cvStartProfiler() call. You can leave it present if you wish to start Coverage Validator from your program.
You can turn data collection on and off using the cvSetCollect() function. 
 
You can use cvGetCollect() to inspect the data collection status.