printing with the ActiveX interface

Our product stores documents, and when they are eDrawings or other CADD documents, uses the eDrawings ActiveX for sending to the printer. This worked with eDrawings 2008 and 2009. However it doesn't with 2010 and up. This part is a VC++ 6.0 ActiveX wrapper.

I found the Get Started example for C#. I expanded the C# example using VS 2008 and eDrawings 2010 to do the printing like our code does.

What happens is the print fails. We have our own print driver and config dialog. The print dialog does not come up. I was able to replicate this with the sample.

 

  In the button1_Click() function:



axEModelViewControl1.OpenDoc("d:\\filesfortest\\house.edrw", false, false, false, "");

axEModelViewControl1.SetPageSetupOptions(EModelView.EMVPrintOrientation.ePortrait, 1, 10999, 8499, 1, 1, "our print driver", 10, 10000, 10, 8400);

 

axEModelViewControl1.Print2(false, "d:\\filesfortest\\house.edrw", false, false, false, EModelView.EMVPrintType.eOneToOne);

If I make the ShowDialog parameter in Print2() true, the eDrawings Print dialog comes up as expected and after clicking OK our Print dialog comes up, which is also true of our code.



When it works, I get the OnFinishedPrintingDocumentEvent and the event has the name of the job. When it fails, I get the OnFailedPrintingDocumentEvent and the print job name in the event is empty.



What do I need to do different? We don't want the eDrawings Print dialog to come up, just ours. We don't have a support subscription so I can't look at the API help. Would there be something in there to help me? In our code the margin parameters are 0. I changed them as above but it still doesn't work. I had tried making the source parameter 0, but that doesn't work either. "our print driver" is set to default Windows printer. There is a second print driver as part of our product, but that behaves the same way.



Thanks for your help.

Don

SolidworksApi macros