Microsoft KB Archive/242319

= PRB: A "The Parameter Is Incorrect" Error Message Is Displayed By A Visual Basic SnapIn =

Article ID: 242319

Article Last Modified on 3/20/2004

-

APPLIES TO


 * Microsoft Management Console 1.1
 * Microsoft Management Console 1.2
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q242319



SYMPTOMS
A Snap-in developed by the Microsoft Management Console (MMC) Snap-in Designer For Microsoft Visual Basic might display the following error message:

Runtime Error -2147024809 (80070057)

The Parameter Is Incorrect



CAUSE
A Toolbar control in the SnapIn project is attempting to use a bitmap from an Image List which is not 16x16 pixels in size.



RESOLUTION
Make sure that all Toolbar controls use bitmaps images that are exactly 16x16 pixels in size.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start Visual Basic and select a new SnapIn project from the New Project dialog box. Open the SnapIn1 Designer from the Project Explorer window and add a new Toolbar and Image List control. By default these news controls will be named ToolBar1 and ImageList1. View the properties of the Image List control, and insert a new bitmap image that is not 16x16. Give the Key field a value for the new image. View the properties of the Toolbar control, and set the ImageList field to ImageList1.</li> On the Buttons tag, insert a new button on the toolbar.</li> Set the Image field to the Key field of the bitmap image in the image list.</li>  Open the Snapin1 Designer's code window and paste in the following code: Private Sub Views_SetControlbar(ByVal View As SnapInLib.View, ByVal Controlbar As SnapInLib.MMCControlbar)

Controlbar.Attach Toolbar1 End Sub

</li> Compile the SnapIn project and load it into MMC.</li> Select the default static node, SnapIn1. The error mentioned in the "Symptoms" section appears.</li> Change the bitmap image in the Image List control to a 16x16 bitmap.</li> Retest the SnapIn. This time the error does not occur.</li></ol>

Additional query words: snapin designer mmc

Keywords: kbprb kbsnapin kbdswmanage2003swept KB242319

-

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

© Microsoft Corporation. All rights reserved.