Example: Accessing VOB properties (VC++)

#include <iostream.h>
#include <atlbase.h>

#import <ccauto.dll>  named_guids
using namespace ClearCase;

int main()

{
     CoInitialize(NULL);

     try
     {
     
         // Create the top-level ClearCase object
         IClearCasePtr cc = IClearCasePtr(CLSID_Application);
     
         // Get a VOB from its VOB tag 
         ICCVOBPtr VOBPtr = cc->GetVOB(L"\\doc");

         char* strMounted;
         if (VOBPtr->GetIsMounted())
             strMounted = " is mounted";
         else
             strMounted = " is not mounted";
     
         // Display some VOB properties 
         cout << VOBPtr->GetTagName() << " on host " << VOBPtr->GetHost() 
             << strMounted << " and has owner " << VOBPtr->GetOwner()
             << " and group " << VOBPtr->GetGroup() << "\n";
     }

     // Catch any COM errors thrown
     catch(_com_error& cerror)
     {
         cout << cerror.Description();
         cout << cerror.Error();
     }

return 0;
}

Feedback