473,498 Members | 1,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Have you faced error while loading BMP from disk???

Hye friends!!
Jigar Mehta from India. Currently I am loading one BMP file around 2.5
MB from the disk from my VC program and show it to its DC... But while
CBitmap object tries to load it by LoadBitmap("c:\\my.bmp"); it gives
error... I get error code of 1814.. I have also tried same program with 90K
BMP file but in that also, it gives the same error...

If you have faced this kind of error, please suggest me the solution...

Herewith, I am appending my code for loading file and displaying it to
DC, if there is any change in code please reply me..

Thank you...

--
Jigar Mehta
jb*******@yahoo.co.in

--------------------------------------
//Code : Jigar Mehta
//Date : 31-12-03

CBitmap bmp;
if(bmp.LoadBitmap("c:\\test1.bmp"))
{
CDC dcMemory;
dcMemory.CreateCompatibleDC(GetDC());
dcMemory.SelectObject(&bmp);
GetDC()->BitBlt(0,0,1152,864,&dcMemory,0,0,SRCCOPY);
}
else
{
DWORD ptr;
ptr = GetLastError();
MessageBox("Error..");
}

//That's it!!!
Nov 17 '05 #1
1 2392
"Jigar Mehta" <jb*******@yahoo.co.in> wrote in message
news:Ow*************@tk2msftngp13.phx.gbl...
Hye friends!!
Jigar Mehta from India. Currently I am loading one BMP file around 2.5
MB from the disk from my VC program and show it to its DC... But while
CBitmap object tries to load it by LoadBitmap("c:\\my.bmp"); it gives
error... I get error code of 1814.. I have also tried same program with 90K BMP file but in that also, it gives the same error...

If you have faced this kind of error, please suggest me the solution...


I could be overlooking it, but I don't see where CBitmap::LoadBitmap is
documented to take a pathspec: only a string or numeric resource identifier.
WinError.h says the value 1814 is assigned to ERROR_RESOURCE_NAME_NOT_FOUND,
which would tend to support this. I think you might be better served if you
were to LoadImage/LR_LOADFROMFILE and call CBitmap::Attach (if you need to).
--
Jeff Partch [VC++ MVP]
Nov 17 '05 #2

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

Similar topics

2
3403
by: Xiao Tencas | last post by:
When trying to load a png image in GD, I get the error (Mozilla Firefox) "cannot display image, because it contains errors"; IE just shows an empty 'image-error' box. When loading a large enough...
4
3503
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
12
6161
by: Sharon | last post by:
I’m wrote a small DLL that used the FreeImage.DLL (that can be found at http://www.codeproject.com/bitmap/graphicsuite.asp). I also wrote a small console application in C++ (unmanaged) that uses...
6
4957
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7167
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,...
1
6890
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
7379
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
5464
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,...
1
4915
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...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.