Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Popup menu

BadGuyBadGuy Member Posts: 19
[b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL

Here is the initialisation code:
[code]
switch (iMsg) {
case WM_CREATE :
SetInternational();
hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
// if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
hMenu = GetSubMenu(hMenu, 0);
if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
return 0 switch (iMsg) {
case WM_CREATE :
SetInternational();
hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
// if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
hMenu = GetSubMenu(hMenu, 0);
if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
return 0;
[/code]

My problem is the second if It returns NULL instead of the menu handler... Anyone


Comments

  • ColdShineColdShine Member Posts: 597
    I could not find any problem here. [b]If[/b] the menu is loaded, GetSubMenu [b]must[/b] succeed. Or tell me if I've missed something...
    _____________________________
    [size=1][b][grey]Cold[/grey][blue]Shine[/blue][/b]
    http://www20.brinkster.com/coldshine[/size]

  • BadGuyBadGuy Member Posts: 19
    : I could not find any problem here. [b]If[/b] the menu is loaded, GetSubMenu [b]must[/b] succeed. Or tell me if I've missed something...
    : _____________________________
    : [size=1][b][grey]Cold[/grey][blue]Shine[/blue][/b]
    : http://www20.brinkster.com/coldshine[/size]
    :
    :
    I tried to if the load menu but it didn't return NULL so it must have returned window handler if I if the getsubmenu it just won't work... if I comment the getsubmenu out it doesn't work neither....
  • grahamojgrahamoj Member Posts: 366
    : [b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
    : Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL
    :
    : Here is the initialisation code:
    : [code]
    : switch (iMsg) {
    : case WM_CREATE :
    : SetInternational();
    : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : hMenu = GetSubMenu(hMenu, 0);
    : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : return 0 switch (iMsg) {
    : case WM_CREATE :
    : SetInternational();
    : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : hMenu = GetSubMenu(hMenu, 0);
    : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : return 0;
    : [/code]
    :
    : My problem is the second if It returns NULL instead of the menu handler... Anyone
    :
    :
    :
    hiya are u trying to create a normal popup menu??
    if u are i can send the code for that..
    grahamoj.
  • BadGuyBadGuy Member Posts: 19
    : : [b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
    : : Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL
    : :
    : : Here is the initialisation code:
    : : [code]
    : : switch (iMsg) {
    : : case WM_CREATE :
    : : SetInternational();
    : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : hMenu = GetSubMenu(hMenu, 0);
    : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : return 0 switch (iMsg) {
    : : case WM_CREATE :
    : : SetInternational();
    : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : hMenu = GetSubMenu(hMenu, 0);
    : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : return 0;
    : : [/code]
    : :
    : : My problem is the second if It returns NULL instead of the menu handler... Anyone
    : :
    : :
    : :
    : hiya are u trying to create a normal popup menu??
    : if u are i can send the code for that..
    : grahamoj.
    :

    If you could do that... It would be great:

    BadGuy@BadGuy.nl if you could send it there
  • grahamojgrahamoj Member Posts: 366
    : : : [b][red]This message was edited by the BadGuy at 2002-7-2 7:39:27[/red][/b][hr]
    : : : Lo I want to create a popup menu on left click I got the left click I also got the hmenu defined my problem is with the getsubmenu wich returns NULL
    : : :
    : : : Here is the initialisation code:
    : : : [code]
    : : : switch (iMsg) {
    : : : case WM_CREATE :
    : : : SetInternational();
    : : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : hMenu = GetSubMenu(hMenu, 0);
    : : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "Doet het niet :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : return 0 switch (iMsg) {
    : : : case WM_CREATE :
    : : : SetInternational();
    : : : hMenu = LoadMenu (hInst, MAKEINTRESOURCE(MENU_1) );
    : : : // if (LoadMenu (hInst, MAKEINTRESOURCE(MENU_1)) == NULL) { MessageBox (hwnd, "It doesn't work :(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : hMenu = GetSubMenu(hMenu, 0);
    : : : if (GetSubMenu(hMenu, 0) == NULL) { MessageBox (hwnd, "It doesn't work:(", szAppName, MB_ICONINFORMATION | MB_OK); }
    : : : return 0;
    : : : [/code]
    : : :
    : : : My problem is the second if It returns NULL instead of the menu handler... Anyone
    : : :
    : : :
    : : :
    : : hiya are u trying to create a normal popup menu??
    : : if u are i can send the code for that..
    : : grahamoj.
    : :
    :
    : If you could do that... It would be great:
    :
    : BadGuy@BadGuy.nl if you could send it there
    :
    hi will send it to you tomorrow for def. have to get it off other machine.
    grahamoj.
  • Justin BibJustin Bib USAMember Posts: 0

    _____ < http://forcoder.org /> free video tutorials and ebooks about < MATLAB Visual Basic .NET Visual Basic Java Scratch PL/SQL JavaScript C Assembly Ruby Python Go R Swift C++ Objective-C Perl Delphi C# PHP Ada Bash Transact-SQL Kotlin Awk Logo Rust Lua Fortran Alice FoxPro Julia ABAP D Dart VBScript Scheme Clojure Hack COBOL ML LabVIEW Prolog Scala F# Lisp SAS Erlang Apex Crystal /> __

Sign In or Register to comment.