Re: SetMapMode



"Steve" <sredmyer@xxxxxxxxxx> wrote in message news:1174657236.096210.12000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

However I do not know what type of window may be passed in
and since what I am writting is an ActiveX component, I can not
even be assured that the passed in window will be a VB window
(might be any window from any enviornment capable of utilizing
ActiveX)

Then you'll just have to do what almost all API functions do and assume that the units which are being passed to them are in units appropriate to the current mapping mode of the DC in question. People who write code which passes coordinates to an API routine to perform some drawing function in a window DC should know what the current mapping mode of that DC is when they decide on the values of the coordinates they want to pass, otherwise they should not be writing code. Almost everyone who writes VB code, for example, uses pixels for the coordinates when calling an API function, regardless of the ScaleMode of the "VB window" they are dealing with. Very few people who write VB code change the mapping mode before making the call to a GDI API, And if they do change the mapping mode they will of course know what the new mapping mode is and they will use the appropriate values for their coordinates. Just have your routine draw its stuff on the assumption that the coordinates which are passed to it are appropriate for the current mapping mode of the DC. That's what most of the API functions do. And if the window handle (or DC or whatever) being passed to your routine is not a VB window then you should assume that the people who wrote the code to call your routine know what they are doing, and know the mapping mode they are using. After all, the Rectangle API (for example) does not say to itself, "I wonder if this DC is a VB DC, and if the person who wrote the code has sent me the coordinates using VB ScaleMode units instead of the current mapping mode units"! The Rectangle API just assumes that the person who called the routine knows what he is doing!

Mike



.



Relevant Pages

  • Re: SetMapMode
    ... even be assured that the passed in window will be a VB window ... current mapping mode of the DC in question. ... Just have your routine draw its stuff on the assumption that ... That's what most of the API functions do. ...
    (microsoft.public.vb.general.discussion)
  • Re: File browser
    ... However, since the API isn't doing what I want, it was my interpretation of the other posts that it was _possible_ that the failure of the API to do what I wanted was due to the improper initialization. ... messages for a specific window handle are delivered only to the message pump running in the same thread that created the window handle. ... And Windows strictly enforces the rule about calling the window procedure; granted, the code that implements the procedure could always call it directly, but if you go through the normal PostMessage/SendMessage API that you're supposed to use, Windows will always cause the execution of the window procedure needed for handling those calls to happen on the same thread that created the window handle. ...
    (comp.lang.java.programmer)
  • Re: Error on Exit Sub
    ... this problem just came to our attention a few days ago; ... out any errors from the API call, he wasn't ready for me to start learning ... > determined you need to lock the window, you can achieve the same effect ... The control/form won't disappear, but its internal ...
    (microsoft.public.vb.general.discussion)
  • Learning Quartz API? Am I on the right track here?
    ... The purpose of the API is pretty simple, it just wraps up the platform ... specific details of instancing a window, ... So I'm asking here, #1 is it worth my time to worry about Quartz, ...
    (comp.sys.mac.programmer.help)
  • Re: Windows Media Tools Corruption
    ... Tried the routine you suggested In ZachD's site - to no avail. ... weird if it also does that in WMP9 menus too, ... in the command window type ...
    (microsoft.public.windowsmedia)

Loading