I have an ATL COM component which creates an instance of the CDIntf:
Code: Select all
CDIntf::ICDIntfPtr pdfPrn = NULL;
hr = pdfPrn.CreateInstance(__uuidof(CDIntf::CDIntf));
I've tried also to create the CDIntf object directly in C# by using COM interop with the same results.
Code: Select all
class Class1
{
[STAThread]
static void Main(string[] args)
{
CDIntf.CDIntf pdfPrn = new CDIntf.CDIntfClass();
pdfPrn.DriverInit("PDFConverter");
pdfPrn.FileNameOptionsEx = 0x20000 + 0x1;
//my printing code here
pdfPrn.FileNameOptions = 0x0;
System.Runtime.InteropServices.Marshal.ReleaseComObject(pdfPrn);
pdfPrn = null;
}
}
Code: Select all
class Class1
{
[STAThread]
static void Main(string[] args)
{
MyThread t = new MyThread();
t.start();
Thread.Sleep(10000);
t.join();
}
}
class MyThread
{
Thread tr = null;
public MyThread()
{
tr = new Thread(new ThreadStart(this.run));
}
public void start()
{
tr.Start();
}
public void join()
{
tr.Join();
}
public void run()
{
CDIntf.CDIntf pdfPrn = new CDIntf.CDIntfClass();
pdfPrn.DriverInit("PDFConverter");
pdfPrn.FileNameOptionsEx = 0x20000 + 0x1;
//printing code here
pdfPrn.FileNameOptions = 0x0;
System.Runtime.InteropServices.Marshal.ReleaseComObject(pdfPrn);
pdfPrn = null;
}
}
Any ideas in regard?
- Marco