PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: reisve on March 18, 2008, 05:51:12 PM

Title: Menu not generating code???
Post by: reisve on March 18, 2008, 05:51:12 PM
I have a form with a menu, but no code was generated for the menu. All I got was:


'------------------------------------------------------------------------------------------------------------------------
Function FRMMONITOR_WM_COMMAND ( _
                               hWndForm     As Dword, _  ' handle of Form
                               hWndControl  As Dword, _  ' handle of Control
                               wNotifyCode  As Long,  _  ' notification code
                               wID          As Long   _  ' item, control, or accelerator identifer
                               ) As Long

End Function
Title: Re: Menu not generating code???
Post by: TechSupport on March 18, 2008, 07:22:56 PM
That's all you're supposed to get. :D

You need to add your SELECT CASE to handle whatever items you want to respond to. For example:


    '//
    '//  Handle items selected from the top menu.
    '//
    Select Case wID
        Case IDC_FRMMAIN_MNUNEWPROJECT, _
             IDC_FRMMAIN_TOOLBAR1_NEW:             Function = cmd_OnNewProject( hWndForm, wID )
       
        Case IDC_FRMMAIN_MNUOPENPROJECT, _
             IDC_FRMMAIN_TOOLBAR1_OPEN:            Function = cmd_OnOpenProject( hWndForm, "" )
       
        Case IDC_FRMMAIN_MNUCLOSEPROJECT:          Function = cmd_OnCloseProject( hWndForm, wID )

      '..... ETC ......

   End Select

Title: Re: Menu not generating code???
Post by: reisve on March 19, 2008, 06:40:01 AM
from the help I got the idea the code would be automaticaly added

Thanks