HINSTANCE hMod=LoadLibrary("Sautinsoft.RTFToHTML.Win32.dll");
printf("Please enter rtf file (example: d:\\my.rtf):\n");
gets(rtffile);
printf("Please enter output folder (example : d:\\temp):\n");
gets(outfolder);
struct convertOptions ct;
ct.cssStartNumber=1;
strcpy(ct.cssStyleName,"ts");
ct.encoding=9;
strcpy(ct.extension,".htm");
strcpy(ct.fontFace,"Verdana");
strcpy(ct.fontSize,"10");
ct.htmlType=1;
ct.preserveFontColor=1;
ct.preserveFontFace=1;
ct.preserveFontSize=1;
ct.preserveImages=1;
ct.preserveHyperlinks=1;
ct.tableBorders=1;
ct.htmlParts=0; //only between <body>...</body>
strcpy(ct.title,"My Page");
strcpy(ct.imageFolder,"D:\\");
strcpy(ct.imageSubfolder,"test.files");
ct.hyperlinkTarget=0;
strcpy(ct.Serial,"Serial number");
ret=ConvertFile(rtffile,outfolder,ct);
switch(ret)
{
case -1 : puts("Unexpected error");break;
case 0 : puts("Conversion completed");break;
case 2 : puts("Not enough memory"); break;
case 3 : puts("Can't open output file"); break;
case 4 : puts("Can't open input file"); break;
case 5 : puts("The input file has zerow length"); break;
case 6: puts("Please check serial number"); break;
default: break;
}
getchar();
FreeLibrary((HMODULE)hMod);