Solved

Alternative for OleLoadPicture function

Posted on 2004-04-06
8
825 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
  • 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 130 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now