Resizing activated embedded object in Office apps  
Author Message
dunny_from_south_oz





PostPosted: Top

MFC >> Resizing activated embedded object in Office apps

I created sample project in VC with compound document support = full
server.
I used simply MFC Application Wizard. Sample.Document - is prog id

run MS Word -> insert Object -> Sample.Document - object is inserted.
Try to resize embedded control - about one second object has changed
size but then it goes to original size (size of metafile picture in
doc file).

what i see in MFC code:
after resizing (COleResizeBar) mfc calls
IOleInPlaceSite::OnPosRectChange()
(Word doesn't change metafile size in doc file)
it calls back COleServerDoc::XOleInPlaceObject::SetObjectRects where
MFC moves
control window to proper place. but after about one second
COleServerDoc::XOleInPlaceObject::SetObjectRects is called again with
original rects. Why does it happen?

I want to reach Excel behaviour. If i insert MS Excel Worksheet object
in doc file therу are no such problems. strictly speaking most
MS products with ole support don't have any problems with each other.

Though "MS paint" has such problem. You may insert "Bitmap Image"
object and try to resize.

so does anyone know proper solution?? How i must adjust MFC code in
order to my OLE object in word works as Excel object???

Visual Studio85