You receive a "System.MissingMemberException" error message while you use an ActiveX Imagelist control (820625)



The information in this article applies to:

  • Microsoft Visual Basic .NET (2002)

SYMPTOMS

You may have a Microsoft Windows Form with an ImageList property of an ActiveX control (such as TreeView, ImageCombo, Toolbar, or ListView) set to the ImageList ActiveX control. When you retrieve values or modify values, such as adding images or deleting images, of the ActiveX control Imagelist property, you may receive the following error message:

An unhandled exception of type 'System.MissingMemberException' occurred in microsoft.visualbasic.dll
Additional information: Public member 'Property' on type 'ExtenderProxy' not found.

CAUSE

Visual Basic 6.0 ActiveX Controls support the IExtender interface that permits you to add additional properties to the default interface of the controls. When you use these ActiveX Controls in Visual Basic .NET, the AxHost class supports the IExtender interface. Therefore, AxHost adds some properties to these ActiveX Controls. However, AxHost does not add the remaining properties to the default interface of the ActiveX Controls. This problem occurs because of a broken IReflect implementation on the ExtenderProxy. Therefore, the properties of the ImageList control are not added to the ActiveX controls (such as Toolbar and TreeView), and you may see the error message at run time.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section. This problem was corrected in Visual Basic .NET (2003).

MORE INFORMATION

Steps to Reproduce the Problem

  1. Create a new Windows application in Microsoft Visual Studio .NET by using Visual Basic .NET.

    By default, Form1 is created.
  2. On the Tools menu, click Customize Toolbox.
  3. On the COM Components tab, click to select Microsoft ImageList Control 6.0 (SP4) and Microsoft ImageComboBox Control 6.0 (SP4) and then click OK.
  4. From the Toolbox, drag an ImageComboCtl control and an ImageListCtrl control to Form1.
  5. Right-click AxImageList1 and then click ActiveX-Properties.
  6. In Properties, click the Images tab and then click Insert Picture.
  7. Move to the Flags folder by following the corresponding path on your computer:

    %Program Files%\Microsoft Visual Studio .NET\Common7\Graphics\icons\Flags

    Select some files and then click Open.
  8. From the Toolbox, drag a Button control to Form1.
  9. Add the following code to the Button1_Click event handler.

    Visual Basic .NET Code
    'Set the ImageList property of ImageCombo control.
    AxImageCombo1.ImageList = AxImageList1.GetOcx
    'Remove the image from AxImageList1 with the bound AxImageCombo1 control. 
    AxImageCombo1.ImageList.ListImages.Remove(1)
  10. On the Debug menu, click Start.
  11. Click Button1. You receive the error message in the "Symptoms" section.

REFERENCES

For more information about the ImageList control, visit the following Microsoft Web site:

http://msdn.microsoft.com/library/en-us/cmctl198/html/vbobjimagelist.asp

For more information about the AxHost class, visit the following Microsoft Web site:

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWindowsFormsAxHostClassTopic.asp

Modification Type:MajorLast Reviewed:1/26/2006
Keywords:kbvs2005swept kbvs2005doesnotapply kbvs2002sp1sweep kbBug kbfix kbComCtrls kbToolbar kbTreeView kbListView kbProperties kbImgList kbWindowsForms kbCtrl kbControl KB820625 kbAudDeveloper