Article ID: 192443
Article Last Modified on 5/12/2003
APPLIES TO
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q192443
SYMPTOMS
When the TabOrder sample Add-In has focus in the Visual Basic integrated
development environment (IDE), shortcut keys (such as Alt+F for the File menu)
are trapped and not passed properly. This results in the following error
message:
Run-time error '438':
Object doesn't support this property or method
RESOLUTION
Follow these steps to edit the TabOrder.vbp project. For the location of
this project, see the MORE INFORMATION section later in this article.
- Add the following function to the docTabOrder user document:
Public Function Hwnd()
Hwnd = UserDocument.Hwnd
End Function
- Edit the HandleKeyDown procedure in the modMain module to read as
follows:
Sub HandleKeyDown(ud As Object, KeyCode As Integer, Shift As Integer)
On Error GoTo ErrExit
If Shift <> 4 Then Exit Sub
If KeyCode < 65 Or KeyCode > 90 Then Exit Sub
If gVBInstance.DisplayModel = vbext_dm_SDI Then Exit Sub
If hwndMenu = 0 Then hwndMenu = FindHwndMenu(ud.hwnd)
PostMessage hwndMenu, WM_SYSKEYDOWN, KeyCode, &H20000000
KeyCode = 0
SetFocus hwndMenu
Exit Sub
ErrExit:
End Sub
STATUS
Microsoft has confirmed this to be a problem in the Microsoft products
listed at the beginning of this article.
Additional query words: checked directory
Keywords: kberrmsg kbide kbaddin kbprb kbpending kbcode KB192443