I have a C++ program which I am running using borland 5.02, It's a GUI program. I need to analyze the program and its flow but the problem is I am not able to find the events of the control and I am not able to search about it in the internet as I am getting information about other C++ versions (FYI, I know it's not VC++). My button code looks like this:
CONTROL "Output Reports", ID_RUN_BITMAP, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 252, 204, 51, 9
Its inside the projectname.rc file
Now, my questions are:
- Which version or variant of C++ I am using?
- I want to know this so that I can search for its tutorial to find its events and to understand the code properly.
Is their any other IDE to run the same code which will be more helpful than Borland 5.02?
P.S.: As I am a C# .NET Programmer and have always used Visual Studio therefore I find that Borland is quite difficult to use.
BC++ 5.02 is from the wild times predating even the 1998 C++ standard; the available subset of features is surprisingly capable but there are many syntactic peculiarities. It is possible to write code that is compatible with current compilers as well as with oldies like BC++ 5.02 (or even BC++ 3.1) but it is not easy.
If you need to target 16-bit platforms then you may be better off using the free/inexpensive Digital Mars C++ compilers (formerly Zortech/Symantec C++) or Open Watcom C++.
If you don't then there are plenty of easier choices.
Dev C++ (gcc 4.8.2/MinGW64-TDM) is very nice but if you need to do GUI development then you'd be better off trying to get a freebie version of Borland C++ Builder (now an Embarcadero product). Visual C++ Express is free and almost as good as
gcc
and CLANG; its advantage is that it can interact directly with .NET, meaning you can paint interfaces with Visual Basic or one of its successors (e.g. C#) and write the tricky, crunchy code in C++ that compiles to a .NET assembly.The framework used by BC++ 4 and 5 is called OWL (Object Windows Library); it is documented in
owl50.hlp
which should be in the help subdirectory of your BC++ installation. The section "About Messages and Message Queues" gives a good overview about control flow and message routing. The framework maps most messages to member functions of classes likeTWindow
etc., so that raw window messages are rarely seen. The user-defined ids mentioned in headers and resource files should re-occur in macro invocations that declare response tables, which should allow you to associate dialog items with the member functions of the corresponding classes. Just grep a bit around and follow your nose.If the program you're analysing was not written for BC++/OWL then you could be facing MFC code (since BC++ 5.x shipped with a copy of the Microsoft Foundation Classes) or raw Windows API code with message pumps, window/dialog procedures etc.
grep
- or some other capable text search tool - should take you to the interesting spots in any case, if you search for magic ids from the RC file likeID_RUN_BITMAP
.