BUG: List Is Not Repopulated in the OLE Standard Insert Object Dialog Box If You Specify IOF_SHOWINSERTCONTROL (259284)



The information in this article applies to:

  • Microsoft COM, when used with:
    • the operating system: Microsoft Windows 2000

This article was previously published under Q259284

SYMPTOMS

When you specify the IOF_SHOWINSERTCONTROL flag in the OleUIInsertObject function or the Microsoft Foundation Class (MFC) COleInsertDialog class, the Create Control radio button is displayed. However, when the user switches between the Create New and Create Control radio buttons, the list does not change.

CAUSE

A cache is added to the OLE standard Insert Object dialog box so that the list of objects appears more quickly. This problem occurs because the cache is not flushed when you change between objects and controls.

RESOLUTION

The cache is cleared only if you call OleUIInsertObject again with a different set of flags. To work around this problem, change the user interface so that the user first has to select whether to insert objects or controls. Then, use the following code so that the user can see a list of either objects or controls:
if (bObjects)
dwFlags=IOF_SELECTCREATENEW;
else
dwFlags=IOF_SHOWINSERTCONTROL | IOF_SELECTCREATECONTROL;
				
In the case of controls, if the user clicks Create New, controls still appear in the list.

STATUS

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

MORE INFORMATION

Steps to Reproduce Behavior

  1. Call the OleUIInsertObject function or the MFC COleInsertDialog class, and make sure that you specify the following flags:
    IOF_SELECTCREATEFROMFILE | IOF_SHOWINSERTCONTROL
    						
    Notice that the Create Control radio button appears, but the Create from File radio button is selected initially.
  2. Click Create New to populate the list with objects, and then click Create Control. Notice that the list does not change (it is not repopulated) to display the controls as expected.

Modification Type:MajorLast Reviewed:10/23/2003
Keywords:kbbug kbfix kbOLEApp KB259284