CoolUtils Logo
German  Italian  Dutch  Spanish  Korean  Russian

Convert HTML Files On Web Servers With Total HTML ConverterX

FREE DOWNLOAD
Buy Total HTML Converter X NOW!
(only $150.00)
Example C++:
#include 

static const CLSID CLSID_HTMLConverterX =
  {0x39A777C6, 0x70A9,0x4D65,{0x84, 0x43, 0x26, 0xC7, 0x7E, 0xAA, 0x0C, 0x92}};
static const IID IID_IHTMLConverterX =
  {0x152F4691, 0x8F0B,0x4D96,{0x82, 0x52, 0x2A, 0x68, 0x28, 0xCD, 0xCE, 0xB9}};

#undef INTERFACE
#define INTERFACE IHTMLConverterX
DECLARE_INTERFACE_(IHTMLConverterX, IDispatch)
{
    STDMETHOD(QueryInterface)(THIS_ REFIID, PVOID*) PURE;
    STDMETHOD(Convert)(THIS_ LPCTSTR, LPCTSTR, LPCTSTR) PURE;
    STDMETHOD(About)(THIS) PURE;
    //const SourceFile: WideString; const DestFile: WideString; const Params: WideString; safecall;
};

typedef HRESULT (__stdcall *hDllGetClassObjectFunc) (REFCLSID, REFIID, void **);

int main () {
  HRESULT hr;
  if (CoInitialize(NULL)) {
    printf ("Error in CoInitialize.");
    return -1;
  }

  LPCTSTR lpFileName = "HTMLConverter.dll";
  HMODULE hModule;
  hModule = LoadLibrary (lpFileName);
  printf ("hModule: %d\n", hModule);
  if (hModule == 0) {
    printf ("Error in LoadLibrary.");
    return -1;
  }

  hDllGetClassObjectFunc hDllGetClassObject = NULL;
  hDllGetClassObject = (hDllGetClassObjectFunc) GetProcAddress (hModule, "DllGetClassObject");
  if (hDllGetClassObject == 0) {
    printf ("Error in GetProcAddress.");
    return -1;
  }
  IClassFactory *pCF = NULL;
  hr = hDllGetClassObject (&CLSID_HTMLConverterX, &IID_IClassFactory, (void **)&pCF);
  /* Can't load with different ID */
  printf ("hr hDllGetClassObject: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in hDllGetClassObject.");
    return -1;
  }
  IHTMLConverterX *pIN;
  hr = pCF->lpVtbl->CreateInstance (pCF, 0, &IID_IHTMLConverterX, (void **)&pIN);
  printf ("hr CreateInstance: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in hDllGetClassObject.");
    return -1;
  }
  hr = pCF->lpVtbl->Release (pCF);
  printf ("hr Release: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in Release.");
    return -1;
  }
  hr = pIN->lpVtbl->About (pIN);
  printf ("hr About: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in About.");
    return -1;
  }
  hr = pIN->lpVtbl->Convert (pIN, "test.HTML", "test.pdf","-cPDF");
  printf ("hr Convert: %d\n", hr);
  if (!SUCCEEDED (hr)) {
    printf ("Error in Convert.");
    return -1;
  }

  return 0;
}

If you need examples on other languages please contact us. We will create any example specially for you.

Note that ActiveX is 32-bit only. If you are trying to use activeX under 64-bit internet information server (IIS) activeX will not work. Use command line version instead (it works with both 32- and 64-bit servers).

More examples

Back to Total HTML Converter X Home

Buy Total HTML Converter X NOW!
    FREE DOWNLOAD  
(only $150.00)
   Updated Sat, 20 May 2017
Total HTML Converter X Preview1Total HTML Converter X Preview2Total HTML Converter X Preview3



Site Map  |  Contacts |  Press Center | Resellers | About |  Privacy Policy |    Copyright © 1998-2017 CoolUtils Development. All rights reserved.   GPlus