help with splash screen

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have a Windows Forms .NET application - I'm trying to display a splash
screen.
I've checked out the online suggestion :

http://support.microsoft.com/default.aspx?scid=kb;en-us;186459

I cut & paste the provided Splash.c into Form1.cpp - I modify my resource.h
to define the bitmap, delete my app.rc & add splash.rc. I also add
Splashu.bmp & Icon1.ico as resource files.

It looks the most promising, but I can't shake 2 errors :
error C2440: '=' : cannot convert from 'HANDLE' to 'HBITMAP'
error C2440: '=' : cannot convert from 'HGDIOBJ' to 'HBRUSH'

I'm guessing I didn't incorporate the splash window properly - what could be
the reason for the error ?

Thanks,
ak
 
There is a conditional definition called STRICT. If this symbol is
defined, the Win32 API header files work in a strict type checking mode.
Normally every handle is a simple typedef to void*, and therefore you
can assign a HANDLE to HBITMAP and back. But if STRICT is #defined,
those types are not compatible, and you have to implicitly cast using
reinterpret_cast (or C-style typecasting, if you prefer so). Such as

HANDLE h = (HANDLE)bitmap_handle;

Take a look at this to see how to enable and disable strict type
checking in the Windows header files.
http://msdn.microsoft.com/library/d...n-us/winprog/winprog/strict_type_checking.asp

Tom
 
Back
Top