OEMActivate Example for Visual C++

void CEPrintDemoView::OEMActivate()
{
   IEPrint *pLeadPrnt; 
   HRESULT hr; 

   hr = ::CoCreateInstance(CLSID_EPrint, NULL, CLSCTX_ALL, IID_IEPrint, (void**) &pLeadPrnt); 
   if(FAILED(hr)) 
      return; 
   
   pLeadPrnt->UnlockSupport(SUPPORT_OEM, "sample key");;
   pLeadPrnt->OEMActivate("sample serial number");

   if(pLeadPrnt) 
   {
      pLeadPrnt->Release();
      pLeadPrnt = NULL; 
   }
}