Hallo, I'm trying to convert a rtf file to pdf file in a VC++ applications using word.
I had install the PDF Printer on my control pannel using install.exe.
In the source code I had insert the automation class CCDIntfEx (CCDIntfEx.h, CCDIntfEx.cpp), and using this code:
#include "cdintfex.h"
void CProvettaDlg::OnButton1()
{
CCDIntfEx h;
TRY
{
// first step operations
h.Create("",WS_CHILD,CRect(0,0,500,500),this,10001);
h.DriverInit("Amyuni Document Converter");
h.EnablePrinter("Company", "Activation Code");
h.SetDefaultPrinter();
h.SetFileNameOptions(1+2);
h.SetDefaultFileName("d:\\temp.pdf");
// Can't print,error
::ShellExecute*this, "print", "d:\\temp.rtf", "",NULL, SW_SHOWMAXIMIZED);
h.RestoreDefaultPrinter();
h.DriverEnd();
}
CATCH(CException, e)
{
}
END_CATCH
}
The PDF Converter is like a default printer and give the right name of the output file, afterwards launch with ShellExecute word applications for print, here I have the problem and the application doesn't work.
What is wrong?
Is the right way for having a pdf file from a rtf file?
Thanks in advanced.
Ricky