Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

CoCreateInstance fails (Class not registered)
Started by cricket at 12-21-2007 11:44. Topic has 4 replies.

Print Search « Previous Thread Next Thread »
  12-21-2007, 11:44
cricket is not online. Last active: 12/19/2007 4:14:04 PM cricket

Top 500 Posts
Joined on 06-22-2007
Posts 11
CoCreateInstance fails (Class not registered)
Reply Quote
I am using ePrint API (4.5.0.025) to set the "Global Printer Options" (Paper Size).
When I am trying to create an "ILEADGlobalPrinterOptions" instance, using "CoCreateInstance", it fails saying "Class not regsitered".

HRESULT hRes = CoCreateInstance(CLSID_LEADGlobalPrinterOptions, NULL, CLSCTX_ALL, IID_ILEADGlobalPrinterOptions, (void**)&m_pGlobalPrinterOptions);

However, I have NO problem in creating "ILEADGlobalSettings" instance with the following call
HRESULT hRes = CoCreateInstance(CLSID_LEADGlobalSettings, NULL, CLSCTX_ALL, IID_ILEADGlobalSettings, (void**)&m_pGlobalSettings);

Am I missing something here? Or, is there any other way to set the "Paper Size" and "Page Orientation"?

Thanks in advance and Awaiting for an early reply/help.

   Report 
  12-24-2007, 9:48
Adnan Ismail is not online. Last active: 10/8/2008 8:10:14 AM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,223
Re: CoCreateInstance fails (Class not registered)
Reply Quote

You should not try to create an instance of the LEADGlobalPrinterOptions object, because this is an internal object. It is a member of the LEADGlobalSettings object exposed through the GlobalPrinterOptions property.
Please see our help code sample for C++, which uses is like this:
pGlobalSettings->GetGlobalPrinterOptions()->PaperSize


Adnan Ismail
LEADTOOLS Technical Support

   Report 
  12-24-2007, 11:47
cricket is not online. Last active: 12/19/2007 4:14:04 PM cricket

Top 500 Posts
Joined on 06-22-2007
Posts 11
Re: CoCreateInstance fails (Class not registered)
Reply Quote

Hi Adnan,

Thanks for the reply and excuse my ignorance. I am new to this (C++ & ePrint API).

But, How do we set the "Page Orientation" (Landscape or Portrait)? I don't see any method!

Thanks in advance.





   Report 
  12-26-2007, 11:22
cricket is not online. Last active: 12/19/2007 4:14:04 PM cricket

Top 500 Posts
Joined on 06-22-2007
Posts 11
Re: CoCreateInstance fails (Class not registered)
Reply Quote
Adnan,

How do we set the Page Orientation (Landscape/Portrait)?
Note: I am using the older version 4.5.0.025

Thanks.


   Report 
  12-27-2007, 5:50
Adnan Ismail is not online. Last active: 10/8/2008 8:10:14 AM Adnan Ismail



Top 10 Posts
Joined on 07-31-2006
Posts 1,223
Re: CoCreateInstance fails (Class not registered)
Reply Quote

The ePrint 4.5 API does not have this feature. You should be able to control the paper properties, including orientation, using the printing application.

In version 5 of ePrint, new features that allow you to create custom printers were added. You can control the paper properties of the added printer, including paper size and orientation.


Adnan Ismail
LEADTOOLS Technical Support

   Report 
Post
LEAD Support Fo... » Developer » ePrint API » CoCreateInstance fails (Class not registered)

Powered by Community Server, by Telligent Systems