15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Changing Embedded objects Icon

Jon Steer -- jsteer@bitscout.com
Sunday, February 09, 1997


  Environment: VC 4.2b , NT 4.0


I am attempting to change an embedded objects icon after the item
has been embedded. What I would like to do is change the embedded
items display icon from the default object icon to 
something else(in my case a icon-sized thumbnail of an image).

To be more specific, I am embedding a graphic image. When
the image is first embedded, I use the default document
icon. After I load another image or maniuplate the image,
I would like to change the icon to that image and
not the default.

To this end, I call 		
	pDoc->UpdateAllItems(NULL,0L,NULL,DVASPECT_ICON);

to update the the icon when the document changes.

While my CMyServerSrvrItem::OnDrawEx does get called, the container
doesn't change the icon. 

I am presuming that sometime after
my OnDrawEx gets called that a CacheGlobalData with the correct
bitmap is going to happen.

What am I missing?

 thanks,
 jon


Jon Steer ---  BitScout Software,Inc --- Software Consulting and Products
Specialties: Device Drivers, Communications, H.320 Systems Consulting
BitScout Software,Inc 40 Berkeley St, Nashua N.H. 03060
phone:(603)889-1185   video: (603)889-1125  fax: (603)-883-9365
E-mail: jsteer@BitScout.com   URL: http://www.BitScout.com/
"I got a box!!" a joyous Lucy Steer, age 2.5; receiving her Christmas
present before realizing that there was actually something inside.




Bing Hou -- hou@tfn.com
Tuesday, February 11, 1997


Take a look the code in COleChangeIconDialog. All you need to do is to 
create a metafile and call the client item's SetIconicMetafile function.
Then call its OnChange with DVASPECT_ICON flag to redraw the new icon.


Bing Hou
hou@tfn.com
------------------------------------------------------------------------
  Recall it as often as you wish, a happy memory never wears out.
                




______________________________ Reply Separator _________________________________
Subject: Changing Embedded objects Icon
Author:  Jon Steer  at Internet
Date:    2/9/97 10:04 PM


     
  Environment: VC 4.2b , NT 4.0
     
     
I am attempting to change an embedded objects icon after the item 
has been embedded. What I would like to do is change the embedded 
items display icon from the default object icon to 
something else(in my case a icon-sized thumbnail of an image).
     
To be more specific, I am embedding a graphic image. When 
the image is first embedded, I use the default document 
icon. After I load another image or maniuplate the image, 
I would like to change the icon to that image and
not the default.
     
To this end, I call             
        pDoc->UpdateAllItems(NULL,0L,NULL,DVASPECT_ICON);
     
to update the the icon when the document changes.
     
While my CMyServerSrvrItem::OnDrawEx does get called, the container 
doesn't change the icon. 
     
I am presuming that sometime after
my OnDrawEx gets called that a CacheGlobalData with the correct 
bitmap is going to happen.
     
What am I missing?
     
 thanks,
 jon
     
     
Jon Steer ---  BitScout Software,Inc --- Software Consulting and Products 
Specialties: Device Drivers, Communications, H.320 Systems Consulting 
BitScout Software,Inc 40 Berkeley St, Nashua N.H. 03060 
phone:(603)889-1185   video: (603)889-1125  fax: (603)-883-9365
E-mail: jsteer@BitScout.com   URL: http://www.BitScout.com/
"I got a box!!" a joyous Lucy Steer, age 2.5; receiving her Christmas 
present before realizing that there was actually something inside.
     




Become an MFC-L member | Вернуться в корень Архива |