Here is the way I load the image:
m_imgCurImage = DRW.Image.FromFile(m_strFilePath, true);
m_bImageLoaded = true;
The m_imgCurImage is a member variable and is held onto until I close it or move on to the next one.
Here is the way I close the image:
private void UnloadImage()
{
if(m_bImageLoaded)
{
m_imgCurImage.Dispose();
m_imgCurImage = null;
}
m_bImageLoaded = false;
}
Any help would be great.
Thanks,
"Shakir Hussain" wrote:
Brain,
Can you paste the code of opening the image? There is a chance that you are
not using proper methods to close the image file. Your code will help me to
investigate the problem.
--
Shak
(Houston)
"Brian Reed" <Br*******@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com... I am trying to use Shell32 objects to move files to the recycling bin upon
user command. The problem is that I have the resource open prior to the
user making the decision to delete the resource (image files). I close them
and call Dispose on them, but I get an 0x402 response and the image is not
recycled. I know it has something to do with using the resource because I
can delete other resources that aren't in use.
I have also tried invoking garbage collection prior to executing the
Shell32 command and I still get the same response.
Any ideas on how to detach from the resource? Also, what does 0x402 mean
exactly?
Thanks,