Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


VB 6.0, Win2k, and Screen.Width (Help!)

This topic is 5988 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Normally, Screen.Width \ Screen.TwipsPerPixelX would result in the number of horizontal pixels across the screen (i.e. 15360 \ 15 = 1024). However while this holds true under Windows 2000, it doesn't once ChangeDisplaySettings() has been called from a VB app. A resolution of 1024x768 changed to a resolution of 800x600 registers as 600x768, and when changed back to 1024x768 results in 768x768. This is not a syntax error or a logic error on my part (as far as I can tell). Screen.Width and Screen.Height seem to be returning the wrong data. This program runs perfectly under Win95, Win98, and WinXP. So is this a NT/2000 bug? Settings under Display Properties shows the correct resolution. Why would Screen.Width and Screen.Height suddenly start giving the wrong dimensions? I hope someone can help clear this up. * Note that both Screen.TwipsPerPixelX and Screen.TwipsPerPixelX return a constant 15 under all the resolutions I have tested, so it's not the twips that are messing things up. [edited by - Xorcist on May 31, 2002 12:17:45 AM]

Share this post

Link to post
Share on other sites
VB6 is chuck full of bugs, you got the latest service pack installed? it cuts down on a number of them. Check and see if there''s a way to tell the screen object to refresh or something...

Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]

[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!