Universal Document Converter
Product Overview
Download
Purchase
Tutorials
Developer Solutions
Support Service
About fCoder Group


      Site search
   


      Video tutorial
Show tutorial


Main page>Developer Solutions>COM Examples

Set Installed Profile as Default Using Visual C++.NET


Universal Document Converter is virtual printer software that saves any document you print as an image file. Below is a source code example that can help you to accomplish your task with Universal Document Converter. Please let us know if you cannot find the solution you need.

// 1) Install Universal Document Converter 3.0 or above on your PC
//
// 2) Create new project in Microsoft Visual Studio.NET:
//  2.1) In "New Project" window:
//     - in "Project Types" tree select "Visual C++ Projects=>MFC",
//     - in "Templates" list select "MFC Application",
//     - enter name of new project and press "OK" button.
//  2.2) In "MFC Application Wisard" open the "Advanced Features"
//       tab, switch on the "Automation" checkbox and press "Finish"
//
// 3) Right click into project name in "Class View" window and
//    select "Add=>Add Class..." in pop-up menu
//
//  3.1) In "Add Class" window please select:
//     - "Visual C++=>MFC" in "Categories" tree,
//     - "MFC Class From TypeLib" in "Templates" list,
//     - press "Open" button.
//
//  3.2) In "Add Class From Typelib Wizard" window please select:
//     - "Add class from:" => "File"
//     - Press "..." button on the right of "Location" field and
//       select "UDCWrapper.dll" file. By default this file
//       should be in folder:
//       "C:\Program Files\Universal Document Converter\SDK\bin"
//
//   3.3) Save files "IPrinter.h" and "IProfile.h" on disk and add
//        into your "stdafx.h" file these includes:
//        #include "IPrinter.h"
//        #include "IProfile.h"
//
// Universal Document Converter COM interface is ready to use now!

#include "IPrinter.h"
#include "IProfile.h"

void SetDefaultProfile()
{
  IPrinter* pUDC;

  pUDC = new IPrinter;
  pUDC->CreateDispatch( "UDCWrapper.Printer" );
  pUDC->put_PrinterName( "Universal Document Converter" );

  IProfile  prof = pUDC->get_Profile("Document to JPEG, Color");
  prof.put_Default(TRUE);

  pUDC->ReleaseDispatch();
  delete pUDC;  
}



Related topics
Popular pages
Popular solutions


© 2001-2008 fCoder Group, Inc. About fCoder Group | Privacy Policy | Site Map