GIDForums  

Go Back   GIDForums > Computer Programming Forums > MS Visual C++ / MFC Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Feb-2005, 10:11
toddm123 toddm123 is offline
New Member
 
Join Date: Feb 2005
Posts: 9
toddm123 is on a distinguished road

Printer Properties->Printer Preferences(Advanced Document Options)


Hi all,

I'm currently working in a c++.net com architecture. I've been looking all day and haven't yet found a way to get or set the printing preferences on my printer.

More specifically Printing Preferences->Document Options->Output Type(overlay, document etc...)

I want to check what the setting for this value is and hopefully figure out how to set it.

I don't want a dialog box appearing to the user though. Users, when using my application, must have their default printer document properties set OUTPUTTYPE to OVERLAY. If you right-click your current printer select PROPERTIES then click PRINTING PREFERENCES, under DOCUMENT OPTIONS you'll see OUTPUT TYPE. Thats the field I want to access, ie: get or set the value from there. I basically want to check the OUTPUTTYPE see if it is OVERLAY, if so then do nothing, if not then either inform the user to change the setting OR change the setting from let's say DOCUMENT to OVERLAY.

You'd think those settings would be stored in the registry. So I could access that value like the code below.

CPP / C++ / C Code:
Microsoft::Win32::RegistryKey *regPrinter; 

String *GetPrinterPort=""; 
String *keyValue; 
keyValue = String::Concat("SYSTEM\\CurrentControlSet\\Control\\Print\\Pr inters\\", printer); 

regPrinter = Microsoft::Win32::Registry::LocalMachine->OpenSubKey(keyValue); 
if (regPrinter) { 
GetPrinterPort = dynamic_cast<String*>(regPrinter->GetValue("Port")); 
regPrinter->Close(); 
} 

Unfortunately I don't see anything under my printer registry settings concerning the OUTPUTTYPE. 

I've found this DocumentProperties and I believe it looks promising work. 

LONG DocumentProperties(
HWND hWnd, // handle to parent window 
HANDLE hPrinter, // handle to printer object
LPTSTR pDeviceName, // device name
PDEVMODE pDevModeOutput, // modified device mode
PDEVMODE pDevModeInput, // original device mode
DWORD fMode // mode options
);

Has anyone ever had any experience with this? Any good code or links you might have would be outstanding. I don't think the .NET arch. will allow me to get that information using PrinterSettings etc... I've been on that aspect for days and have yet to find anything useful. Not really sure where to go from here.

Has anyone ever seen this before?

HELP!

Any help would be greatly appreciated.

Thanks,
Todd
Last edited by LuciWiz : 13-Feb-2005 at 04:39. Reason: Please insert your C++ code between [c++] & [/c++] tags
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:02.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.