How To Start using the API
You can use Mapper sample as a template for your virtual disk code.
Just remove WinAPI calls or Stream object operations from the callback / event handlers and replace them with your own logic.
If you start from scratch, here's the sequence of calls to CBFSConnect API to use:
- Call SetRegistrationKey to set the license key and enable CBFS Connect.
CBFS Connect doesn't work without the license key (either registered or evaluation).
You can request the evaluation key via the request form.
- Install the driver if it has not been installed yet.
You don't need to call Install every time your application is started.
In production you can install the driver by calling Installer DLL functions from your application installation script.
- Call Initialize method to initialize CBFS Connect. Initialize method must be called on each application start.
- Create a virtual disk device using CreateStorage method.
- Call MountMedia method to "insert a disk" to the virtual device.
- Create one or more mounting points (this can be drive letter, UNC path or directory on existing NTFS drive).
You can add several mounting points to one disk device using AddMountingPoint method.
- Now it's time to ensure, that the driver can read and write from / to the storage.
You must implement handlers for events present in CBFSConnect class.
Some events are optional and they are marked as such. All other events are mandatory.
- When you finish work with the disk, unmount it.
- You can change the "disks" without deleting and recreating a disk device using MountMedia and UnmountMedia methods.
- Delete the storage from the system using DeleteStorage method.
- To remove the driver from the system, call Uninstall method.