C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old July 4th, 2002, 06:03 AM
BadGuy BadGuy is offline
Designer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: Netherlands
Posts: 104 BadGuy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 22 m 16 sec
Reputation Power: 7
Send a message via ICQ to BadGuy
Borland C++ 5 Popup menu

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, "It doesn't work :(", 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;



My problem is the second if It returns NULL instead of the menu handler... Any takers?

Using (like I said) Borland 5.0

Reply With Quote
  #2  
Old July 6th, 2002, 01:01 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,432 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 4 Weeks 1 Day 22 h 29 m 51 sec
Reputation Power: 784
This may be a dumb thing to ask, but exactly how deep is your popup menu from the main menu? The reason I'm asking is because I see that you're calling GetSubMenu twice (which means you're trying to access a third level menu). Also, after this line:
hMenu = GetSubMenu(hMenu, 0);

Can you confirm that hMenu is not null at this point?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Borland C++ 5 Popup menu


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway