Nevermind- I worked through it:
ListPrinters()
dim pc as CPMPrinterMBS
dim ar() as string //instead of ar as CFArrayMBS
dim i,index,c as integer
dim o as CFObjectMBS
dim r as CPMResolutionMBS
dim s as string //instead of s as CFStringMBS
ListBox1.DeleteAllRows
ps.CreatePrinterList(ar,index,pc)
if ar<>nil then
c=ar.Ubound
for i=0 to c
s=ar(i)
if s<>"" then
ListBox1.AddRow s
if i=index then
ListBox1.CellBold(index,0)=true
end if
end if
next
end if
Window1.Pushbutton3.Action
Dim s as string
if ListBox1.ListIndex>=0 then
s=Listbox1.cell(ListBox1.ListIndex,0)
//Add Shell
dim sh as shell
sh = new shell
sh.execute "lpoptions -d"+s
if ps.LastError=0 then
ListPrinters
else
MsgBox "Error: "+str(ps.LastError)
end if
end if
On Aug 3, 2012, at 3:43 PM, A. Christopher Rosado wrote:
> Hi Christian,
>
> I'm getting a compile error when running your Change Current Printer example
> (Carbon):
> ListPrinters()
> ps.CreatePrinterList(ar,index,pc)
>
> Is there another way to get the list?
>
> Thanks,
>
> --Christopher
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info