帮助PDFCreator和System.Activator.CreateInstance()请。 [英] Help with PDFCreator and System.Activator.CreateInstance() Please.

查看:66
本文介绍了帮助PDFCreator和System.Activator.CreateInstance()请。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码初始化PDFCreator的实例。

但是我试图设置其中的选项。

有人有什么建议吗?

谢谢。

I'm using the following code to initialize an instance of PDFCreator.
However I am lost trying to set the options thereof.
Has anyone any suggestions?
Thanks.

void IntPdfCreator()
    {
        string parameters;

        pdfCreatorType = System.Type.GetTypeFromProgID("PDFCreator.clsPDFCreator");
        PDFCreator = System.Activator.CreateInstance(pdfCreatorType);

        //PDFCreator = new PDFCreator.clsPDFCreator();
        parameters = "/NoProcessingAtStartup";

        if (PDFCreator.cStart(parameters))
        {
            //PDFCreator.set_cOption("PDFGeneralAutorotate", 1);
            //PDFCreator.cOption("PDFGeneralAutorotate");
            //PDFCreator.cOptions.PDFGeneralAutorotate = 1;
            PDFCreator.cClearCache();
            PDFCreator.cPrinterStop = true;
        }
        else
        {
            MessageBox.Show("Blimey, we can't start...");
        }

推荐答案

请参阅我对该问题的评论。你没有提供你想要使用的库的链接,但你的代码看起来完全疯了,即使不知道它。



根据成员的名字你是使用,必须是这样的: http://angrez.blogspot.com /2007/06/create-pdf-in-net-using-pdfcreator.html [ ^ ]。



如你所见,没有毫无意义的 System.Activator ,而不是反射。你不能指望任何非废话库的反射方法。其他非常不同的东西需要反思。



-SA
Please see my comment to the question. You did not provide a link to the library you are trying to use, but your code looks completely insane even without knowing it.

By the names of the members you are using, it must be this: http://angrez.blogspot.com/2007/06/create-pdf-in-net-using-pdfcreator.html[^].

As you can see, no pointless System.Activator, not reflection. You cannot expect reflection approach form any non-nonsense library. Reflection is needed for other, very different things.

—SA


这篇关于帮助PDFCreator和System.Activator.CreateInstance()请。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆