Re: Get list of printers

Niklas Nebel <[email protected]> Fri, 08 Apr 2011 13:21:24 +0200
Newsgroups gmane.comp.openoffice.devel.api
Message-ID <[email protected]>
On 07.04.2011 22:43, Marc Santhoff wrote:
> Can you explain why the intermediate step using Core Reflection is
> necessary, please?

As Andrew wrote: The usual logic, where Introspection finds the methods 
from all supported interfaces, requires XTypeProvider.

>> From those old times there is another macro that must have been working,
> and it doesn't (work or use CoreReflection):
>
> function PrinterNameListNew
> 	ps = CreateUnoService("com.sun.star.awt.PrinterServer")
> 	dbgM(ps)
> 	dbgP(ps)
> 	dim xps as object
> 	xps = ps.QueryInterface("com.sun.star.awt.XPrinterServer")
> 	if NOT IsNull(xps) then
> 		dbgM(xps)
> 	else
> 		msgbox "NULL"
> 	endif
> 	PrinterNameListNew = ps.getPrinterNames()
> end function

In fact, this will work in 3.4, where the "Type" parameter for 
queryInterface can be given as a string (issue 116184).

Niklas
--
-----------------------------------------------------------------
To unsubscribe send email to [email protected]
For additional commands send email to [email protected]
with Subject: help