Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Alternative for OleLoadPicture function

Posted on 2004-04-06
8
Medium Priority
?
849 Views
Last Modified: 2010-05-19
I have an image file (any type). I read it  buffer by buffer (of type byte) then I place the content into a memory area of size of the file allocated using GlobalAlloc function. My idea is to have the content of the file transfered to this global memory area. Then I have to create a picture object on the contents of this memory area. I tried OleLoadPicture but it fails in the case of corrupted images. I would like to have an alternative method for doing the above function
0
Comment
Question by:tincyt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 10767838
>I tried OleLoadPicture but it fails in the case of corrupted images. I would like to have an alternative method for doing the above function

What do you mean? If the images are corrupted, why do you still want to open them?
0
 

Author Comment

by:tincyt
ID: 10771688
It is known only that the file is an image file. It can be identified whether it is corrupted or not and also the module doesnot know what type of image is it
0
 
LVL 23

Expert Comment

by:chensu
ID: 10772037
>It can be identified whether it is corrupted or not

Can or cannot?

>Alternative for OleLoadPicture function

What functionality are you looking for?

What exactly is that you are trying to do?
0
 

Author Comment

by:tincyt
ID: 10773848
It cannot be identified whether it is corrupted or not.

I want to read  the file content, place it in global memory allocated and then create a picture object with the content of the global memory. I don't want to use OleLoadPicture function
0
 
LVL 23

Accepted Solution

by:
chensu earned 520 total points
ID: 10776439
OleLoadPicture should return you an error code when the image is corrupted.  What functionalities are you looking for that are not provided by OleLoadPicture?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question