473,405 Members | 2,415 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.

help with splash screen

AK
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...b;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
Nov 17 '05 #1
2 2980
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/de...e_checking.asp

Tom
AK wrote:
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...b;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

Nov 17 '05 #2
AK
Yes, that did it - I forced a cast -> (HBITMAP) & it worked.
Thanks for the help,
ak

"Tamas Demjen" wrote:
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/de...e_checking.asp

Tom
AK wrote:
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...b;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

Nov 17 '05 #3

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

Similar topics

3
by: andrewcw | last post by:
I implemented the simplest of splash screens ( static and on its own thread ). But it seem that when first called maybe 8 seconds elapsed before it showed up, the main form follows several seconds...
14
by: SStory | last post by:
I am trying to make a splash screen for my vb.net app. It is an mdi app. including the splash code produces wierd results. not inluding makes things fine. Also have tried loading the splash...
3
by: Maileen | last post by:
Hi, I have a module in which are define 2 forms as below : '------ Module Module1 Public MyMain As New FMain Public MySplash As New FSplash Public Sub Main() MySplash.Show()
11
by: K E Senthil Kumar | last post by:
Hi, I have created an application which uses a SQL server database. I created a mainform which retreives all the customers. This takes about 3sec. I have created a splash screen too. I use a...
2
by: Joe Cool | last post by:
Using VB in VS2005. 2005 has a new way to implment a spash screen that alleviates the need for hardly any code. But I have found that when a GUI that has a splash screen is run as a scheduled task,...
1
by: Ken Allen | last post by:
I am developing a small utility program that must perform a considerable amount of 'background' or 'research' work before it can display any user interface. In general it can take 3-15 seconds to...
5
by: steve | last post by:
Hi All I have a form set as the splash screen in VB.net 2005 application properties How can I tell when it has or is closing, as I want to then run some licence checking code without the...
2
by: will_456 | last post by:
In vb2005 Express: In My Project Application Splash Screen I have selected my splash screen form. The form opens on project startup but closes immediately before anyone would have time to read...
0
by: Paulson | last post by:
Hi all I am making a desktop(windows) Application using vb.net.The problrm is I cannot close the Splash screen in the splash screen I am activating the main form.Once this is done I close the...
2
by: Newbie | last post by:
Hi, In the application properties of my vb.net 2008 project I have set one of my forms to be the splash screen. How do I increase the time the splash screen is displayed for. It vanishs to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.