Logo

arrow2 File Converters

arrow2 Forensic

arrow2 TIFF and PDF apps

arrow2 Freeware

Total HTML Converter X

Convert HTML Files On Web Servers With Total HTML ConverterX

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

Download

Get all CoolUtils products
for $99 only
read more

  (you save up to $500)


Total HTML Converter X Preview1

Coolutils.com

Latest News

Newsletter Subscribe

No worries, we don't spam.


© 2019. All rights reserved. CoolUtils File Converters

Cards