TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: RAY GEAR
from: ADAM MAJER
date: 1998-01-24 11:42:00
subject: Borland c++ v 4.52

RG> #define EXITMENU       1
RG> #define CM_EXIT        24310
RG> #define CM_HEIGHT26    106
RG> #define CM_HEIGHT20    105
RG> #define CM_HEIGHT14    104
RG> #define CM_HEIGHT10    103
RG> #define CM_HEIGHT8     101
RG> The first line seems to be the problem. With that removed the menu
RG> appears in the window. Following is part of the code to set up the window
RG> sub class and assign the menu.
It shouldn't be. Make sure that you enable ALL warning and error
messages for it should give you a better clue of what's going on.
RG> #include 
RG> #include 
RG> #include 
RG> #include 
RG> #include 
RG> #include 
WARNING: I'm using Borland C++ 3.1 with OWL 1.0 so some of the
modifications might not work although they should.
Try replacing the above with
#include 
and make sure that you have all the neccessary libraries and paths
included.
RG> #include 
/////////////////////////////////////////////////////////////////////
// This is just a simple break line ;-)
////////////////////////////////////////////////////////////////////
RG>#include "window2.rh"         // This is the file above
RG>class TMyWindow : public TWindow
RG>{
RG>public:
RG>        TMyWindow(Twindow* parent = 0);
RG>        ~TMyWindow();
RG>protected:
RG>        virtual void SetupWindow();
RG>        BOOL CanClose();
Isn't CanClose() public for TWindow?
RG>        void CmExit();
Delete the above function. By default CanClose is called on exit and
most of the cleaning up should be done there or in the class
destructor - ~TMyWindow();
RG>        void CmHeight8();
RG>        // rest of menu items as above line
RG>private:
RG>         TFont * pFont;
RG>        void newFont(int);
RG>
DECLARE_RESPONSE_TABLE(TMyWindow); RG>};
RG>DEFINE_RESPONSE_TABLE1(TMyWindow, TWindow)
RG>        EV_COMMAND(CM_EXIT, CmExit),
RG>        EV_COMMAND(CM_HEIGHT8, CmHeight8,
RG>        //rest of menu options as above line
RG>END_RESPONSE_TABLE;
RG>class TMyApp : public TApplication
RG>{
RG>public:
RG>        TMyApp() : TApplication() {}
RG>        void InitMainWindow()
RG>        {
RG>                SetMainWindow(new TFrameWindow(0, "Title", new 
MyWindow));
RG>                GetMainWindow()->AssignMenu("EXITMENU");
                   Use AssignMenu(EXITMENU) or             <- int handle
                   AssignMenu(MEKEINTRESOURCE(EXITMENU))   <- string
                   EnableBWCC(TRUE); }
Try:
        virtual void InitMainWindow()
        {
                MainWindow = new TMyWindow(NULL);
                // might not work with your version but try it ;-)
                // Assign the menu in the SetupWindow() of the window.
        };
Hope that helps. ;-)
 * SLMR 2.1a * Hello, I am part number ################
--- FMail 0.92
---------------
* Origin: The Programmer's Oasis on FIDONET! (1:348/203)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.