Select windows printer/plotter

Hi! I need some help, i have searched for it at http://discussion.bentley.com/ and i have found nothing, and i'm thinking its impossible... i'm working with a v7 to v8 microstation mdl code, and adding some features requested, one of them, is a window/dialog to select a networked or phisical printer/plotter alreaddy installed in the machine, something like the "Select Printer" groupbox in this screenshot. http://help.allegheny.edu/tutorials/images/print/winxp_printer15.gif is it possible? how can i do it? i have a vc++ and vb6 compiler to develop a dll if i need it thankyou
Parents
  • matatunos:
    I'm working with a v7 to v8 microstation MDL code, and adding some features. One of them, is a window/dialog to select a networked or physical printer/plotter already installed in the machine.

    The simplest way to control printing from MDL or VBA is to queue PRINT commands to the print application PLTDLG. However, that won't get you the a of Windows printers. You will need a Windows API way to enumerate the Windows printers, so your user can select one for queuing with your PRINT command.

    We don't know the complexity of your existing MDL that you want to port to V8. It may be simpler to rewrite the application in VBA (which did not exist in V7), because that gives you access to Windows tools such as a printer enumerator.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

Reply
  • matatunos:
    I'm working with a v7 to v8 microstation MDL code, and adding some features. One of them, is a window/dialog to select a networked or physical printer/plotter already installed in the machine.

    The simplest way to control printing from MDL or VBA is to queue PRINT commands to the print application PLTDLG. However, that won't get you the a of Windows printers. You will need a Windows API way to enumerate the Windows printers, so your user can select one for queuing with your PRINT command.

    We don't know the complexity of your existing MDL that you want to port to V8. It may be simpler to rewrite the application in VBA (which did not exist in V7), because that gives you access to Windows tools such as a printer enumerator.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

Children
  • the v7 .mc source file is about 15.000 lines long, the .r file is about 2500 lines long, and i'm quite new to mdl programming I am new too with VC++, but i know i can add some funcionalities with it i have some code void get_printers(char *impresora) { CPrintDialog dlg(FALSE); dlg.DoModal(); strcpy(impresora,dlg.GetDeviceName()); } i call it from my .mc with char impress[1024]; get_printers(impress); and it returns the name of the printer, something like "\\TRASGU\NRG SP C811DN PCL 6" or blank if you cancel de dialog box now i'm working with personalization of this dialog