Microsoft KB Archive/314441

= BUG: PowerPoint 2002 Stops Responding When Resizing Visual Basic ActiveX Control While in Design Mode =

Article ID: 314441

Article Last Modified on 1/30/2007

-

APPLIES TO


 * Microsoft PowerPoint 2002 Standard Edition
 * Microsoft Visual Basic 6.0 Professional Edition

-



This article was previously published under Q314441



SYMPTOMS
If an ActiveX control is written in Visual Basic 6.0 and supports the EditAtDesignTime property, and you insert the control on a slide that is open in PowerPoint 2002, and you then activate and try to resize the control during design time, PowerPoint 2002 may stop responding (hang) indefinitely or crash during the resize operation. This problem does not occur with earlier versions of PowerPoint.



CAUSE
When you resize an ActiveX control in design mode, PowerPoint temporarily deactivates the control and resizes it by calling IOleObject::SetExtent. If this method is called on a Visual Basic control that has been previously activated but is not currently in-place active, Visual Basic calls the IOleClientSite::RequestNewObjectLayout method of the container to notify it that a resize is being requested.

By default, PowerPoint uses the IOleClientSite::RequestNewObjectLayout method to renegotiate space with OLE objects that want to expand while they are in-place active. PowerPoint does not expect an ActiveX control to call this method for a normal resize. This causes PowerPoint and Visual Basic to renegotiate the space for the control, instead of only setting the size for the control.

Due to a change in the way PowerPoint 2002 handles the renegotiation of space, PowerPoint may inadvertently continue to enlarge the object beyond the original resize, and may call IOleObject::SetExtent again with a larger size. The Visual Basic control again responds with a call to IOleClientSite::RequestNewObjectLayout, and the process repeats itself. Because of this, the computer stops responding until PowerPoint runs out of stack space or overflows an internal variable, causing a crash.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
Create a Visual Basic Control

To reproduce the problem, you need a Visual Basic control that supports design-time activation. If you do not have one, follow these steps to create the control:
 * 1) Start Visual Basic 6.0 and create a new ActiveX Control project.
 * 2) On the Project menu, click Project1 Properties, and then type Testpptctl for Project Name.
 * 3) In the Properties window, rename UserControl1 as MyTestControl, and set the EditAtDesignTime property to True.
 * 4) Add a text box to MyTestControl.
 * 5) Save the project. On the File menu, click Make TestPPTCtl.ocx.

Use the Control in PowerPoint 2002
 * 1) Start PowerPoint 2002 and create a new presentation with a single slide.
 * 2) On the View menu, click Toolbars, and then click Control Toolbox to show the Control Toolbox command bar (if this command bar is not already visible).
 * 3) Click the More Controls button and locate the Visual Basic control that you just created (TestPPTCtl.MyTestControl Object). Select TestPPTCtl.MyTestControl Object and then insert the control on the slide.
 * 4) Right-click the control, click TestPPTCtl.MyTestControl Object, and then click Edit. This in-place activates the control while it is still in design mode, so that you can edit the data for the control.
 * 5) While the control is active, resize the control to make it larger (for example, make the control twice its original size). PowerPoint stops responding or crashes when it tries to resize the control.

Keywords: kbbug kbpending KB314441

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.