Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving DeviceMode from Printer object or Common Dialog properties 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am using the windows common dialog control and I am using the showprinter method. I set the PrinterDefault Property to true. This changes the pointer that vb has to the reserved word "printer" or vb.printer. I need to retrieve the DeviceName and DeviceMode properties from that object or from the common dialog. I don't want to have to declare the devmode type and allocate the memory for the object and then fill in the properties. I can get the deviceName property from the printer object. So my question is: Is there any way to retrieve the DeviceMode of a printer from the printer object or possibly a function that returns a deviceMode type from a devicename or something to that effect. Many thanks in advance for the help.

Cheers
 
Unfortunately, VB is weak in this area. And the VB CommonDialog Print is almost worthless. It doesn't even return the hDC, even though that is a property of the CD.

I use API functions to do everything needed, calling them from VB.

That is however too much code to paste it here.

I'll see if I can dig something up....
 
Just what I was looking for.
Is it better to put each code portion into a seperate module?
 
If anyone could email me that snipet i would apprecieate it. I have been working on this for a staggering 3 months. Thanks,
James@trusswood.serverbox.org Thanks,
James
[shadeshappy] [evil]
 
If anyone still has this piece of code, please email it to me. I am struggling with an issue of a Windows 95a pc getting a runtime error when the print common dialog box is shown for the second time without closing the application down. It prints correctly the first time, the second time you hit the "print" button, the app bombs when you call the print common dialog box again. If they close the application and come back in each time they want to print, there is no issue.
Thanks!


Gail Dengler
GDengler@boscovs.com
 
Thanks so much CClint! Hopefully I can now get this monkey off my back.
Gail

Gail Dengler
GDengler@boscovs.com
 
i don't understand how this relates, this is for the common dialog correct? I want to modify the printer with out user intervention. Basicaly i have the printer setup before printing. This program i use creates daily reports, and asking the user to modifty his/her settings is a little. Am i understanding the page wrong?

Thanks,
James
[shadeshappy] [evil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top