How to get paper size from dmPaperSize returned from GetDevMode?

For example, dmPaperSize returns 1 which is DMPAPER_LETTER, how do I
calculate the paper size like in this case 8.5"x11"?

There are so many paper sizes, is there any function call to calculate
based on the return value of dmPaperSize or mapping between the value
of dmPapersize and actual size?

Thank you.

0
guxu (22)
8/21/2005 10:03:40 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
911 Views

Similar Articles

[PageSpeed] 33

The reason I asked the question was because dmPaperLength and
dmPaperWidth are 0 for some printers.

Also, my HP laserjet returns as a color printer (dmColor = 2) from
GetDevMode call. Anyone knows why?

0
guxu (22)
8/21/2005 10:08:28 PM
Reply:

Similar Artilces:

How to get XML data out of an XML file
I am trying to retrieve the Parameters first or second (0, 1 ,2) node from the following XML file: <?xml version="1.0" encoding="utf-8" ?> <Robot xmlns="http://tempuri.org/RobotDefaults.xsd"> <Parameters> <Name>Decker</Name> </Parameters> <Parameters> <Name>A</Name> </Parameters> <Parameters> <Name>B</Name> </Parameters> </Robot> There will be more data than just a name for each Parameters node. Here is my code: Dim node As XmlNode = xmlDocument.SelectSingleNode("/P...

Baseball Stats question: How can I get the RBI's?
I have a data table that looks like this: Code ------------------- STR-S SNK-S STR-K STR-F SNK-S STR-3 STR-2 STR-F SNK-S SNK-4 SNK-S STR-3 SNK-F STR-4 STR-O ------------------- "STR", etc at the beginning are pitch types, SNK is Sinker for example The end character is the result of the pitch, a 4 would be a home run, 3 a triple, and so forth. O is out, F is foul, S is strike --- you ge it. How can I figure the amount of RBI's? I know that it's 5, but I can' think of any automated way to calculate this, anyone got any ideas? THANK YOU!! :confused -- AVER...

Get at messages in queue
Is it possible to get at the undeliverable messages that are held in a queue (eg to check the message body or redirect undeliverable messages). I would like to be able to selectively forward them to an alternate email address or to archive them to a PST etc rather than just deleting them? Thanks Alan ...

calculating return in a range
Hi, I have a range of stock prices. with indication for buy or sell. and i want to calculate the return of the range for example : buy 522.73 buy 527.9 buy 528.81 buy 532.33 buy 535.1 buy 536.23 buy 537.03 buy 538.57 sell 537.54 sell 532.86 sell 538.14 sell 533.08 buy 531.22 I want to calculate the return for the first buy signal. the range is from the start to the first sell signal 537.54- 522.73 then the sell range untill the first buy signal 531.22- 537.54 and so on.... -- kman ------------------------------------------------------------------------ kman's Profile: http://www.e...

How to get paper size from dmPaperSize returned from GetDevMode?
For example, dmPaperSize returns 1 which is DMPAPER_LETTER, how do I calculate the paper size like in this case 8.5"x11"? There are so many paper sizes, is there any function call to calculate based on the return value of dmPaperSize or mapping between the value of dmPapersize and actual size? Thank you. The reason I asked the question was because dmPaperLength and dmPaperWidth are 0 for some printers. Also, my HP laserjet returns as a color printer (dmColor = 2) from GetDevMode call. Anyone knows why? ...

does vista installed on virtual machine 2007 get wsus updates ?
It is searching for updates but it is not finding anything and saying that Windows is up to date. I have set the updates to install from the wsus server and assigned the updates to the same Vista virtual machine .. Thank you -- aconti ------------------------------------------------------------------------ aconti's Profile: http://forums.techarena.in/members/73272.htm View this thread: http://forums.techarena.in/active-directory/1290161.htm http://forums.techarena.in Hello aconti, If the machine is getting the correct GPO for the WSUS settings, check with rsop...

How do I get text to copy from one cell to another ?
Type = in the target cell. MouseClick the cell containing text. Pres Enter key -- Brian ----------------------------------------------------------------------- BrianB's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=5 View this thread: http://www.excelforum.com/showthread.php?threadid=27034 ...

OAB field size limitations
Hi, we've noticed several user display names getting cut off within the offline address book. There appears to be a limit of 64 characters. If I look at the corresponding user entry in the "live" address book it displays correctly. If I search for the user in my copy of the offline address book it is cut off at the 64 character mark. Does anyone know if this is indeed a limitation of the OAB? I can't seem to find much about this anywhere. OAB property filtering for Exchange 2003 Service Pack 2 OAB Version 4 - http://blogs.msdn.com/dgoldman/archive/2006/04/29/586827.asp...

Getting Cell Value from the Concatenate formula
I built a concatenate formula that returns the following result: =Jul! $D27 I am looking for the cell contents of Sheet: July Column D Row 27. I tried to use offset, but I am stumped. Can I add something to the front of the concatenate to not only build the reference to the cell, but also return the value instead of the =Jul!$D27 ? Thanks John =indirect(yourformulahere) Don't include the equal sign in your formula. And match the name correctly (Jul or July???). Depending on the name of the worksheet, you may need to have a string that looks like: 'Sheet 99'!d27 =indirec...

Can't get rules to run.
I can't get Outlook 2003 rules to run. I am getting my mail from a pop3 account and would like to have new mail sorted to specific folders when it arrives. I set up the rules as I did in previous versions of outlook, but they do not run automatically. I can run the rules manually and they will move the mail. I have this rule (for example Apply this rule after the message arrive from some@email.address and on this machine only move it to the somefolder folde I have tried deselecting on this machine only Thanks. Do you have an Exchange service in this profile? Are you using Cache...

Getting same number to appear over and again
Hi. I'm trying to change the E's I have entered in a column to 1's. However, in lieu of changing them one by one, I would like to do them all in one fell swoop. Any suggestions? John Hi John You could use find and replace. Select all of your data. Goto Edit>Find Find what:- E Replace with:- 1 HTH Martin John Do NOT multipost. See your answer in Excel group. And do a google search for newsgroup etiquette!! John Do NOT multipost. See your answer in Excel group. And do a google search for newsgroup etiquette!! John Do NOT multipost. See your answer in Excel ...

Why do my questions get deleted sometimes?
Apologies, I have posted this on the worksheet functions group too... I love the feedback I get from these groups, but every now and then, my messages get deleted. I'd like to know what I'm doing wrong. Many of my messages ARE posted and answered, and I'm grateful for that, but one or two get removed - regardless of how often I post them. I don't swear or say anything bad about Excel - I love it. So why don't they get posted are there some words or subjects that I should avoid? Will this one get deleted - it's a bit off subject? But I'd love to have an ans...

Getting right date value
I setup my DTPicker control to be used only as a date control, yet I'm noticing that sometimes it will give back a date AND a time all in the same "value" variable. Since it appears that a variable of type "Date" can give back both a date and time, how can I eliminate the time half of a date value??? I might not be able to exactly control the DTPicker control to give me JUST a date, so I'm just curious what to do if it gives me back both a date & time. thank u Hi, Try this : Dim x as date x = cdate(clng(DTPicker1.value)) &qu...

modify contact address when account address gets modified
Hi, How do I ripple my changes from company level to the related contacts ? For example the main company phone number and the main address ? Do I need a product like Scribe for this, or can this be done with the workflow ? Thanks for any advice Wim You can't do this with workflow, and I don't believe Scribe can do this (though I may be wrong - I've only used Scribe for one project). I would think that you'd need to create a post callout using the SDK. There is more info at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/CrmSdk1_2/htm/v1d2microsoftcrmversi...

Become MCSE Certified and get $43,000+ Salary per year
QmVjb21lIE1DU0UgQ2VydGlmaWVkIGFuZCBnZXQgJDQzLDAwMCsgU2FsYXJ5IHBlciB5ZWFyCkhp LApTdGFydCB5b3VyIGJyaWdodCBjYXJlZXIgd2l0aCBNQ1NFIENlcnRpZmljYXRpb24gYW5kIGdl dCAkNDMsMTIyLjUwCihhY2NvcmRpbmcgdG8gYWJvdXQuY29tIHNhbGFyeSBzdXJ2ZXkpLiBWaXNp dCBodHRwOi8vd3d3LkZyZWVFeGFtS2luZy5jb20KZm9yIE1DU0UgQ2VydGlmaWNhdGlvbiwgRnJl ZSBQcmFjdGljZSBFeGFtcywgRnJlZSBTdHVkeSBNYXRlcmlhbCAvCkJvb2tzIGFuZCBGcmVlIER1 bXBzIIWFCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09Cg== ...

don't understand MkDir in Windoze, get runtime error
I want to create the "c:\test" directory if it isn't already created. If it is created I want it to do nothing. So the first time I run my sub procedure it does create the directory but the second time I run it, it does not do nothing it gives me a runtime error. "Path/file access error on the MkDir line. So I guess I need a better test than the one I have? Can you help? tia, If Dir(STR_DIRECTORY_PATH) = "" Then MkDir STR_DIRECTORY_PATH Else End If That is because the directory already exists..... so, try: ? dir("c:\oem",vbDirectory)...

makro to return email
I want a makro that if a check box is checked, a email is send to a recipient. See your other mail and http://www.rondebruin.nl/sendmail.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Esrei" <anonymous@discussions.microsoft.com> wrote in message news:174801c50514$05025190$a401280a@phx.gbl... >I want a makro that if a check box is checked, a email is > send to a recipient. ...

Return the "name box" to the tool bar.
The "name box" disappeared from the tool bar. The name box is ususally on the left end of the format tool bar. It allows the user to view the underlining formulas etc. as opposed to the data or answer displayed in the cell. One way: Tools/Customize. In the Toolbars pane, select Formatting toolbar (e.g., "Formatting" highlighted, not just the checkbox checked). Click Reset. In article <8E82A125-6086-4686-8E53-9F96823C083E@microsoft.com>, ^mike^ <^mike^@discussions.microsoft.com> wrote: > The "name box" disappeared from the tool bar. Th...

I keep getting an error "Operation cannot be completed, one or mo.
I have just installed Office Professinal 2003. Every time I try to use any of the features in Outlook I get the following; "Operation cannot be completed, one or more parameter values are not valid" PLEASE advise! Here is Info from microsoft KB You receive the "One or more parameter values are not valid" error message when you update a task in Outlook 2000 or in Outlook 2002 http://support.microsoft.com/default.aspx?scid=kb;en-us;197036 This info for Outlook 2000, and Outlook 2002, but If this info match with your case, follow instruction. "BigMac" <...

Adding button to Form, How to get the wizard?
Hello, I am adding a button to my form and I need the button to open, save or close other forms. I want the wizard to start directly after I add the button to the form. I started first time but than I have to changed someting and it is not running anymore. Can you help me? Thanks a lot Jan, When you have the form in design view goto the Toolbox toolbar and ensure that the Control Wizard (2nd button from the left) button is selected (highlighted). This button can be enabled or disabled. when enable the wizard will startup when disabled it leaves you to do all the worksetup yourself...

screen size
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Is there anyway to make a word document take up more screen area? I have a 20&quot; screen and when word opens it only takes up about a third of the screen area? never mind I just figured it out! Word opens each document at the window size and zoom ratio it was last saved at. To set this for blank documents, you need to re-save your Normal template. Unless you have moved it, it should be in /Users/~/Library/Application Support/Microsoft/Office/User Templates/ CLOSE all other documents, then u...

Services Invoices Get "DROP SHIP" box checked Automatically
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01CA45AC.F9A0B1F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello Everybody, Here is another story. we are GP 10 SP3 and we also a Field Service (Depot Module) installed = for which we use an Invoice ( SVC000000) and our type is Service type = Invoice. At the time of posting the Service Charges being generated by the Depot = Module, the Drop ship box gets checked automatically for which we can't = charge the customer for shipping charges. Basically we eve...

Can I have problem if change size of a drive with s.o.
I have a RAID 5 setup and have divided the space into 3 drives (C, E, F). Where C is operating system, E is virtual disk and F is DataDisk. The system is Windows 2003 + Exchange 2003 + other program. Now I want to add a new disk to my array (1 array,1 logical unit,3 disk partition) reconfigure array and logical unit finally change di size of disk C with a free space give me by new disk. It possible all without losing data? Thanks very much in advance. I don't think so. The array reconfig will want to wipe and start anew.... "Mirko M." <MirkoM@discussions.microso...

Discharging a message box with return key
Hi, I handle PreTranslateMessage, look for VK_RETURN in a edit control, the SendMessage() to a button press handler, OnApply(). The effect is, when the user presses RETURN in a specified edit ctrl, the 'Apply' button is pressed programicly. The OnApply() method issues a MessageBox() system modal. Pressing enter to discharge the message box causes the message box to disapear( as expected) but then for some reason PreTranslateMessage receives that return key press, and calls OnApply() again... Clicking OK in the message box works as expectred. Why do i see the return key press in ...

Getting all Sproc through one query
Hi all, can anyone help in getting below information from all stored procedure from one DB we have 100 procedure in one DB of sql server 2005.instead if of manully getting info for each procedure i want all below details in one shot or one query Procedure Name : Input Parameter : Output Parameter : Called By : Calls : Dependent tables : Thanks in advance ...