473,405 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Visual C++ / Vista

I am transferring some of my code (half written games, etc) from an old
(Win98) PC to a laptop running Vista.

The following function no longer works.

void DisplayBitmap (char* filename, UINT width, UINT height)
{
HANDLE hBitmap = ::LoadImage (g_hInstance, filename,
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);

PAINTSTRUCT ps;
HDC hDC = ::BeginPaint (hWnd, &ps);
HDC memDC = ::CreateCompatibleDC (hDC);
HGDIOBJ hObj = ::SelectObject (memDC, hBitmap);
BOOL bRes = ::BitBlt (hDC, 0, 0, width, height,
memDC, 0, 0, SRCCOPY);

::DeleteDC (memDC);
::EndPaint (hWnd, &ps);
::DeleteObject (hBitmap);

::InvalidateRect (hWnd, &rect, true);
}

Everything returns TRUE or valid handles, but I get a white screen.

Any ideas?
** Posted from http://www.teranews.com **
Sep 30 '08 #1
1 1538
HGallon wrote:
I am transferring some of my code (half written games, etc) from an old
(Win98) PC to a laptop running Vista.

The following function no longer works.

void DisplayBitmap (char* filename, UINT width, UINT height)
{
HANDLE hBitmap = ::LoadImage (g_hInstance, filename,
IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);

PAINTSTRUCT ps;
HDC hDC = ::BeginPaint (hWnd, &ps);
HDC memDC = ::CreateCompatibleDC (hDC);
HGDIOBJ hObj = ::SelectObject (memDC, hBitmap);
BOOL bRes = ::BitBlt (hDC, 0, 0, width, height,
memDC, 0, 0, SRCCOPY);

::DeleteDC (memDC);
::EndPaint (hWnd, &ps);
::DeleteObject (hBitmap);

::InvalidateRect (hWnd, &rect, true);
}

Everything returns TRUE or valid handles, but I get a white screen.

Any ideas?
** Posted from http://www.teranews.com **
Please post in * windows * related forums.
Sep 30 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Frank Rizzo | last post by:
I've heard rumblings here and there that various versions of Visual Studio will not run on Vista. I can't find definitive explanation anywhere of which one will run and which one won't. I am...
13
by: Mark Rae | last post by:
Hi, On Friday I attended the Microsoft EVO conference in London where they talked about Vista, Office 2007 and Exchange 2007 and how they all work together beautifully, how they were all...
8
by: Miro | last post by:
I was searching on Microsoft's site and found this link: http://support.microsoft.com/lifecycle/search/?sort=PN&alpha=Visual+Studio It stumpped me on something. ( im new to visual studio /...
3
by: =?Utf-8?B?cmF1ZXI=?= | last post by:
I am using Visual C++ 6 Professional in Windows XP. Which new developer product should I use under Vista Business operating system that continues to use the C++ programming language? I understand...
9
by: | last post by:
Does anyone know which edition of Vista you have to buy if you use Visual Studio and probably will upgrade to Visual Studio 2008? Is the Ultimate edition necessary, or will the home or business...
24
by: JJ | last post by:
I see the new software is 'RTM' but what does that mean in terms of when we can actually purchase it? Thanks, JJ
11
by: =?Utf-8?B?S3VlaXNoaW9uZyBUdQ==?= | last post by:
I am running Visual studio 2003 with framework 1.1 on a vista platform. However it runs very slow in debug mode, especially while it is loading dlls. What is the problem? Is there a compatibility...
3
by: nzmike | last post by:
Hi, Hoping someone out there can help me... I just built a new Vista Home Premium 64 PC. So far everything has gone well so this morning I decided to install Visual Studio 2005 Professional....
5
by: =?Utf-8?B?QXJuZSBHYXJ2YW5kZXI=?= | last post by:
Does Visual Studio 2005 and Visual Studio 2008 work well together on a Vista computer? I am having some issues with Ajax development. Neither VS2005 nor VS 2008 work well since I installed Visual...
3
by: techtonator | last post by:
Hi All, I wonder why I bought the Vista Home Premium 64 bit laptop (perhaps only the 64 bit thing lured me :) :( ) because I am unable to do anything really useful on the machine. Here is another...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.