Solved

Alternative for OleLoadPicture function

Posted on 2004-04-06
8
840 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

713 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