Mapping Modes

Hi - I'm trying to learn some MFC. At the moment I'm reading abot GDI;
specifically mapping modes. Unfortunately the book does a poor job on this
subject, leaving me with headaches :)

I'm hoping some of you might help me with this. I have, of course, already
looked at the MSDN documentation for the function call in question, but I'm
still lost (a litte anyway).

Here goes:

I have the following code:
    pDC->SetMapMode(MM_ANISOTROPIC);

    pDC->SetWindowExt(1440, 1440);

    pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX),
pDC->GetDeviceCaps(LOGPIXELSY));

So what's going on here?
I know what the SetMapMode function does. Yay.
And the SetWindowExt function sets up the window to 1440 by 1440 logical
units.
What I don't get is why I need the SetViewPortExt call! It sets the viewport
apparently. But ehm....I just sat up the
window to 1440 by 1440 why is this view port function needed?
And the arguments? With LOGPIXELSX and LOGPIXELSY it sets the viewport up to
the  number of pixels per logical inch which I can't find much sense in.

Help? Please?

(I've tried to search for some tutorials on mapping modes....but without
much success).

Thanks in advance
Jacob


0
8/20/2003 6:06:56 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
897 Views

Similar Articles

[PageSpeed] 20

"Jacob N. Rohde" <digital_rohde@hotmail.com> skrev i en meddelelse
news:bi0dck$3qj$1@news.cybercity.dk...
> Hi - I'm trying to learn some MFC. At the moment I'm reading abot GDI;
> specifically mapping modes. Unfortunately the book does a poor job on this
> subject, leaving me with headaches :)
>
> I'm hoping some of you might help me with this. I have, of course, already
> looked at the MSDN documentation for the function call in question, but
I'm
> still lost (a litte anyway).
>
> Here goes:
>
> I have the following code:
>     pDC->SetMapMode(MM_ANISOTROPIC);
>
>     pDC->SetWindowExt(1440, 1440);
>
>     pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX),
> pDC->GetDeviceCaps(LOGPIXELSY));
>
> So what's going on here?
> I know what the SetMapMode function does. Yay.
> And the SetWindowExt function sets up the window to 1440 by 1440 logical
> units.
> What I don't get is why I need the SetViewPortExt call! It sets the
viewport
> apparently. But ehm....I just sat up the
> window to 1440 by 1440 why is this view port function needed?
> And the arguments? With LOGPIXELSX and LOGPIXELSY it sets the viewport up
to
> the  number of pixels per logical inch which I can't find much sense in.
>
> Help? Please?
>
> (I've tried to search for some tutorials on mapping modes....but without
> much success).
>
> Thanks in advance
> Jacob
>
>

Never mind. I JUST saw the light. I love it when that happens. Sorry for
waste of bandwidth :):)


0
8/20/2003 6:25:57 PM
Reply:

Similar Artilces:

Item Integration should allow mapping to Extended Pricing Price S
When Extended Pricing is enabled and you use Integration Manager to bring in prices, you map a Constant Price Level EXTPRCLVL to get the integration to go through. The only problem is that this doesn't affect the Price Sheets, so doesn't calculate a price in Sales Order Processing. It would be nice if a collection could be added for Price Sheets. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the but...

Mapping..
ok. I have a table with about... ohh 250 fields. Lets say that one field is directly dependant on another. In this case, a region number is given to a person based on their postal code. In SQL I could just create a second table and link them using postal code as the key. How can I accompish this in CRM? I'm assuming its by using the mapping feature but in the documentation I have it tells me to go in through the SQL enterprise manager. I have been told that I am not allowed to directly access the SQL database without voidding my warranty. How can I make it so that the region number...

how do i map an excel column to an XML element
How do i map an entire column of data in an excel spreadsheet to an XML data element in the XML source Task Pane? I want to export the data in my spreadsheet so that every row in my spreadsheet is an XML record and every cell in the row is a sub element ...

Outlook 2K3/Exchange 200, Cached Mode, mail not showing up
I've found the post listed below; the same problem I'm having. I've searched and found no other reference to this, or a fix. Is anyone else having this problem, and is there a fix or workaround for it? Thanks ------------------------------------------------------------------------------- >We were having issues with Outlook 2003's Cached Exchange server mode >connecting to an Exchange 2000 server. The problem we experienced was >basically the user was unable to receive messages, when this setting was >enabled the users didn't get messages for 1 month! To fix...

Can Visio convert and or open an iGrafx process map?
I have a process map done in Corel iGrafx Flowcharter 2003 and want to know if I can convert the file such that I can edit and play with it in Visio Professional 2003. Thanks I have an IGX format file that needs to be converted to Visio as well. Seems some seminar presenters are giving out their sample files in this format, and I would REALLY prefer not to add yet another flow charting tool to our environment here. Has anyone developed a solution for this? Thanks! "Dellitot" wrote: > I have a process map done in Corel iGrafx Flowcharter 2003 and want to know > ...

Mfg. Bom report in graphics mode
The BOM REPORT does not print correctly in graphics mode. It does print ok in text mode. In graphics mode, each page is missing data as if the program expects the paper to be longer than 11 inches. This is not a modified report -- Sheri Salomone THANKS! ...

can not change E2003 to native mode
I am unable to change my Exchange 2003 server organization to Native mode. The option is grayed out in the ESM. Currently we are in Mixed mode. I have recently removed my last Exchange 5.5 server from my Exchange system. I do not see any references to my old server "Ironman" anywhere in my ESM or AD Users and Computer, or AD Sites and Services. I thought I have cleaned all remaining elements of the old 5.5 from the AD metabase but there must be something remaining that I can not find. I need to install Exchange 2003 on the server that used to be 5.5 but I want to change to na...

Going from Custom Menus to Design mode
I have a database that I had setup with a custom menu and a dashboard. I need to edit the Design but forgot how to exit to Design Mode. I need to hold a key down but forgot what that was. I assume this is the same for all custom menu databases. Can anyone help with the instructions to do this? On Mon, 18 Feb 2008 13:46:01 -0800, EPB <EPB@discussions.microsoft.com> wrote: Hold down the Shift key while opening the database. -Tom. >I have a database that I had setup with a custom menu and a dashboard. I >need to edit the Design but forgot how to exit to Design Mode. >...

Map command
Have got Windows XP professional. Excel used to have the facility to create a map from a worksheet but this does not appear to be in the Insert Menu anymore. Can anyone tell me how to create a map in XP? Windows XP Professional is an Operating System. Do you mean Office XP Professional? If so, you are out of luck with the Insert>Map feature unless you purchase MS MapPoint software. Excel XP has done away with the Mapping component. Gord Dibben Excel MVP On Wed, 19 Jan 2005 07:41:08 -0800, "suemkay" <suemkay@discussions.microsoft.com> wrote: >Have got Windows X...

Using Custom Mapped fields when importing in Outlook 2002
I am trying to import a *.csv file from Excel into contacts of Outlook 2002. I have created a custome made contact form and made it my default, but when trying to map the fields within the import wizard, my custom made contact form is not used to map to. Any ideas on how to make the mapped to reflect my user defined fields? Thanks! ...

worksheet map
I have some fairly complicated excel files with let say 100 worksheets in them. What I would like to do is be able to generate a "map" that would show me graphically how all the worksheets in the file are linked to each other. i, How would that differ from using Trace...dependents, precedents ? Jim Cone San Francisco, USA "ixlr84fun" <ixlr84fun@gmail.com> wrote in message news:1135280427.415301.26280@g44g2000cwa.googlegroups.com I have some fairly complicated excel files with let say 100 worksheets in them. What I would like to do is be able to generate a "...

"Map" button
Does the "Map" button exist in 2003 EXCELL Hi no, MS has disconitnued this support with Excel 2002 -- Regards Frank Kabel Frankfurt, Germany "NLeites" <NLeites@discussions.microsoft.com> schrieb im Newsbeitrag news:A47AFEDE-097D-4BDC-B1F5-CD902D880C95@microsoft.com... > Does the "Map" button exist in 2003 EXCELL You must now purchase MapPoint program which interfaces with Office apps. Gord Dibben Excel MVP On Thu, 11 Nov 2004 23:19:40 +0100, "Frank Kabel" <frank.kabel@freenet.de> wrote: >Hi >no, MS has disconitnued this suppo...

How to map a string to a map pointer?
Hi, I have several strings, each of which should be mapped to a specific map of string to string structure. How to implement by the CMap template? Or is there an type- specific Map classes I can use? Thanks. Gary My first guess would be something like: CMap<string, string, string, string> m_MyStringMap; but I'm not sure what results mixing MFC and STL will produce. "Gary" <gary_gzi@yahoo.com> wrote in message news:085f01c38160$c04a1570$a401280a@phx.gbl... > Hi, > > I have several strings, each of which should be mapped to > a specific map of...

Map one more column map within a single XSD element.
Map one more column map within a single XSD element. I have export the xml file from the excel file format, the data has in one more column a xml element data. How can I map one more column? In my XSD (problem is "sub-item" element) <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="body"> <xsd:complexType> <xsd:sequence> <xsd:element name="item-group" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:sequence> <xsd:element name="item...

X-Y map of 2 issues with one PIN
I want to map on an x-y chart two issues about 2 to 4 products I want to map the products by 1) there price & 2) there complexity I built the data and the chart but my problem is that I am getting 2 sets of plotted pins - one set is how you would expect in various points on the chart the problem is that there is a second set of plot points that run acroos the bottm of the chart and if you remove that plot range from the chart then the other polt points are no longer dynamic. This use to be easy You need to share some more about what you are doing. What are you plotting? Price...

Install Module choices mapped to Help Menu Module Listing
Hello, when installing GPv10 you have choices of what to install. For example: EFT for Receivables, Electronic Bank Reconciliation, Professional Services Tools Library, etc. But when you go under Help>Options and display the registration report it's not a one-to-one mapping of what you chose when doing the install. For example modules listed in my registration report that are not registered are Cashbook Bank Management, Bank One Commercial Card Integration, Bank One Direct Paycheck Card Integration. I don't know if these are mapped to EFT for Receivables or Electronic Bank Recon...

Map data to map of USA
I would like to map 50 pieces of data to the states on a map of the USA & then to fill each state with a color, increasing in intensity as the number rises. Does this sound like something that can be done in Excel? Hi, Earlier version of Excel came with a map utility Now you have to pay for it. http://www.microsoft.com/mappoint/2004/default.mspx You might find this of use, although it will require some adapting. http://www.andypope.info/ngs/ng12.htm Cheers Andy Moo wrote: > I would like to map 50 pieces of data to the states on a map of the USA & > then to fill each sta...

map real estate prices with google maps at HomePriceMaps.com #2
http://www.HomePriceMaps.com integrates how much homes SOLD for nationwide using the google mapping technology. Simply select city and state from the city menu and click search. If you don't see data for your area simply email HomePriceMaps@gmail.com with your zipcode and or address and they'll update the site with your info and email you within a few days. ...

Help needed with writing files in binary mode.
I need to add writing a binary file to my application and I haven't had much experience with writing files. I've been trying to understand and use examples found on the web and here is what I've been working with. 'Start code: Dim i As Integer Dim nFileNum As Integer Dim sFilename As String sFilename = "C:\Temp.bin" Open sFilename For Binary Access Write As #nFileNum ' Put data in the file For i = 0 To 15 'Write #nFileNum, , i Put #nFileNum, , i Next i Close #nFileNum 'End code This works but when I look at the file usi...

Map
can we define a const map , which will take both key and value also to be constants? something like this........... const std::map< const unsigned char,const unsigned char> sample_map; In that case how to we populate it???????? You can't. The problem with 'const' is that it is a little too extreme for a lot of data objects. This is a case where, in spite of the fact it is "logically" const, you can't declare that syntactically, because, as you point out, you won't be able to populate it. joe On Mon, 21 Aug 2006 01:59:01 -0700, Alamelu <Alamelu...

Leads to Accounts --> Map Territory?
Is it possible to create a field in Leads called Territory and have it map to the Territiry Lookup in Accounts Rhett The territory field on the Account is actually a territoryID as the territory details are stored as a seperate entity. Although, the territoryID appears in the mapping attributes (deployment managers schema manager), you would need to make sure that the territoryID is entered into the Lead entity. Which is going to be a GUID and would be impossible to get the user to enter with any degree of accuracy. No, you really can't. But you can add a Territory picklist field ...

Mappings not working when creating a new entity
Hi, Not sure if this has been discussed yet but I noticed that depending on how I create my new record the mappings work or do not work. Scenerio #1: I am in an entity "hotel setup", I click on an associated entity Selected Hotel. Click new and the hotel name mappings come over. This one works as expected. Scenerio #2: I am in another entity, click on the associated entity Selected Hotel, click new and add the lookup to the hotel setup. Click save and no mappings come over. Is there a way to do this? Thanks in advance. Brian Hi Brian, Yes, it is the expected behaviour. Map...

How do I add new Map Custom Fields or Maps.
I am trying to import a Excel 2007 file into Outlook 2007, I first changed the file extesion to excel- 2003 format. When I try to import the excel file into outlook I get a Map call Cody_Mail with address only fields. The program will not let me modify or delete this Map and will note let me build a new Map with the correct custom fields. Did you simply "change" the extension or actually re-save it as an .xls file? First option will do nothing but cause potential problems. As for your "Cody_Mail" map - likely to be the only "Named Range" found assum...

Mapping Network Drive
I have a Desktop with WinXP SP3 (all the latest updates), and a laptop with Win 7. I have my desktop harddrive divided in 3 partitions and normally share my "E" drive with my laptop. Prior to Win7, I had Vista on the laptop and the sharing worked fine. I have a Linksys 4-Port Router so I can share the drive and also the Internet with the laptop. The Internet works fine with the setup after installing Win7, but the file sharing does not seem to work now. It kept telling that it "could not connect to some drives - my E drive" - I removed the mapping on the lapto...

Synchronizing offline GAL in Cached Exchange Mode?
Setup: Exchange 2000 running on Windows 2000 server; Outlook 2003 running on Windows 2000 workstations. All patches and updates installed up-to-the-minute. Problem: When I modify some accounts in the active directory of the server, the changes do not propagate to the offline GAL's of the machines using cached exchange mode ... they appear in machines NOT using caching with no problem. So how do I go about synchronizing the offline address lists with the current active directory? Isn't this supposed to happen automatically? (What ELSE could explain the non-existence of any ...