I'm trying to automate opening Acrobat Reader and printing a pdf file using the Acrobat ActiveX control. I create the PDF control just fine, but for one reason or another the LoadFile fails. I think I'm missing something, because Acrobat Reader is not showing up in the task manager. I'm using Acrobat 6.0 and MS Visual C++ .NET 2003 (7.1). Does anyone know what I'm doing wrong? Any help would be greatly appreciated.
using namespace std;
HRESULT hr = pdf.CreateInstance("PDF.PdfCtrl.5"); // Returns S_OK
hr = pdf->LoadFile("c:\\vpd.pdf"); // Throws error
hr = pdf->Print();
string error = ce.ErrorMessage(); // Error says "Catastrophic failure"