BC++4.5 --> 5.0 OWL no graphic display?

Posted on 1998-06-08
Last Modified: 2012-05-04
I was programming using Borland C++ 4.5 before. I write some programs using the OWL. Recently, I upgraded my Borland C++ to 5.0. I re-compile some of my program codes again and surprising, none of my programs display anything on the screen while I run those "new" files. The only thing displayed on the screen is the window frame and the title... can anyone tell me what is the problem? or did I do something wrong with my program codes? Below is the program code of  a simple program which displays a game board:

#include <owl\applicat.h>
#include <owl\framewin.h>
#include <owl\gdiobjec.h>
#include <owl\point.h>
#include <owl\dc.h>
#define LIMIT 5
#define EMPTY 0
#define BLACK 1
#define WHITE 2
class MyApp:public TApplication
   void InitMainWindow();

class MyMainWndw:public TFrameWindow
      MyMainWndw(TWindow *parent, const char far *title);

       UINT blockX, blockY, Chess[LIMIT][LIMIT];
   RECT rect;
   void Paint(TDC &paintDC, BOOL, TRect&);
   void EvSize(UINT, TSize &size);
   void EvLButtonDown(UINT, TPoint &point);
   void EvRButtonDown(UINT, TPoint &point);


MyMainWndw::MyMainWndw(TWindow  *parent, const char far *title):TFrameWindow(parent,title)
      for (int x=0; x<LIMIT;x++)
         for (int y=0; y<LIMIT; y++)

void MyMainWndw::EvSize(UINT, TSize &size)

void MyMainWndw::EvLButtonDown(UINT,TPoint &point)
      int x=point.x/blockX;
   int y=point.y/blockY;

void MyMainWndw::EvRButtonDown(UINT,TPoint &point)
      int x=point.x/blockX;
   int y=point.y/blockY;

void MyMainWndw::Paint(TDC &paintDC, BOOL, TRect&)
      int x,y;
        char szBuffer[]="1233456";
   TBrush *BlackBrush=new TBrush(TColor::Black);
   TBrush *WhiteBrush=new TBrush(TColor::White);
   TPen *BlackPen=new TPen(TColor::Black);

   for( x=0; x<LIMIT;x++)
         for( y=0;y<LIMIT;y++)

   for (x=0; x<LIMIT; x++)
               if (Chess[x][y]==BLACK)
            else if (Chess[x][y]==WHITE)
      delete BlackBrush;
   delete WhiteBrush;
   delete BlackPen;

void MyApp::InitMainWindow()
      TFrameWindow *wndw=new MyMainWndw(0, "Hit Test by Mouse");

int OwlMain(int, char*[])
      return MyApp().Run();
Question by:rw8
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Accepted Solution

Tommy Hui earned 100 total points
ID: 1165406
If you set a break point on your paint function, is it getting called? I would instead use EvPaint to make sure the window is getting the WM_PAINT message and doing the right thing.

Author Comment

ID: 1165407
I have changed the Paint to EvPaint but the result is still the same. I have added a breakpoint inside the EvPaint and find that EvPaint is never get called..
Did I forget to add something in my program code?

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Grammars for C C++ and java 1 145
Unresolved External Symbols 3 156
VS2015 Redefinition errors 4 102
using interface in TLB 3 29
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question