There is an SDK (Microsoft's Software Development Kit) example program that does this that ships with CVI. If you don't have the Full Development version (includes SDK) libraries then you won't be able to do this. The example is in cvi\samples\sdk\stdio\demo.prj.
Best Regards,
Chris Matthews
Measurement Studio Support Manager