[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

adding a menu to borland C++ project

I have made a simple windowsprogram, I am using borland C++ 5.0. I now want to add a simple menu, I have generated a menu using resource workshop, it generates a .rc file, compiling it generates a .res file. I have specified the name of the menu when defining the window class. But I guess I'm missing something, I get no menu! Pleas help!
0
sa9813
Asked:
sa9813
  • 2
1 Solution
 
AlexVirochovskyCommented:
If you use OWL:
  MainWindow->AssignMenu(ID_MAINMENU);
in you InitMainWindow() function.
ID_MAINMENU must be in you RC file:
ID_MAINMENU MENU
{
}

In plain Window may be something as:
#pragma argsused
int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
          LPSTR lpszCmd, int nCmdShow)
{
   static char szAppName[] = "CHelp" ;
   HWND        hwnd ;
   MSG         msg ;
   WNDCLASS    wndclass ;
   HANDLE    hAccel;

   if (!hPrevInstance)
   {
  ....
      wndclass.lpszMenuName  = MAKEINTRESOURCE(ID_MAINMENU  );
   .....

      RegisterClass (&wndclass) ;
  }
....
In Console/EasyWin Apps : without menu.
Test you Borlandc Examples (or i can send you some full project: write you
Email).
I hope, it helps. Alex



0
 
sa9813Author Commented:
Is it okey if I send you my project and you can look? It's very straightforward...
0
 
AlexVirochovskyCommented:
You can send me you project to
alexvirochovsky@yahoo.com and
ask you question and i9 allway reply. But i want ask you: you evaluate my reply in "D" grade. Why and what wrong in my reply?

0

Featured Post

The eGuide to Automating Firewall Change Control

Today‚Äôs IT environment is constantly changing, which affects security policies and firewall rules. Discover tips to help you embrace this change through process improvement & identify areas where automation & actionable intelligence can enhance both security and business agility.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now