473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Link in Borland C++ Builder 6

i need to make 4 different forms in 1 project in borland C++ Builder.forms r different but there is some similar tasks of them.so i made a common base form with similar tasks and all codes of similar tasks r same.now from the base form develop 4 other form.
example:
suppose one base form "Base"->with 3 common button save new Close.

now need to make another 4 forms including these 3 task.so save this "BASE" form in four Different names and also "Add this file to the project".and develop these 4 forms seperately.all codes of similar tasks r in base form.
Problem is that in BASE form Button i write the code;but when run the other forms and click the buton.it doesn't close.
how to link between base and other forms
Base form
#include <vcl.h>
#pragma hdrstop

#include "BaseMD.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TBaseMDForm *BaseMDForm;
//---------------------------------------------------------------------------
__fastcall TBaseMDForm::TBaseMDForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TBaseMDForm::ExitClick(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
One other form:

#include <vcl.h>
#pragma hdrstop

#include "PurOrder.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TPurOrderForm *PurOrderForm;
//---------------------------------------------------------------------------
__fastcall TPurOrderForm::TPurOrderForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
Feb 6 '07 #1
1 3436
AdrianH
1,251 Expert 1GB
i need to make 4 different forms in 1 project in borland C++ Builder.forms r different but there is some similar tasks of them.so i made a common base form with similar tasks and all codes of similar tasks r same.now from the base form develop 4 other form.
example:
suppose one base form "Base"->with 3 common button save new Close.

now need to make another 4 forms including these 3 task.so save this "BASE" form in four Different names and also "Add this file to the project".and develop these 4 forms seperately.all codes of similar tasks r in base form.
Problem is that in BASE form Button i write the code;but when run the other forms and click the buton.it doesn't close.
how to link between base and other forms
Base form
Expand|Select|Wrap|Line Numbers
  1. #include <vcl.h>
  2. #pragma hdrstop
  3.  
  4. #include "BaseMD.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma resource "*.dfm"
  8. TBaseMDForm *BaseMDForm;
  9. //---------------------------------------------------------------------------
  10. __fastcall TBaseMDForm::TBaseMDForm(TComponent* Owner)
  11.         : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TBaseMDForm::ExitClick(TObject *Sender)
  16. {
  17. Close();
  18. }
  19. //---------------------------------------------------------------------------
  20.  
One other form:

Expand|Select|Wrap|Line Numbers
  1. #include <vcl.h>
  2. #pragma hdrstop
  3.  
  4. #include "PurOrder.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma resource "*.dfm"
  8. TPurOrderForm *PurOrderForm;
  9. //---------------------------------------------------------------------------
  10. __fastcall TPurOrderForm::TPurOrderForm(TComponent* Owner)
  11.         : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------

Well, your is-a relationship is sound, inheirtance is resonable. However, your code snippets are incomplete to make any sence of them as you have only included the source files. Please include the header files, where the definition of the TBaseMDForm and the TPurOrderForm are located. I know nothing about Borland's C++ Builder, but I could determine what is going on with the definition of the classes.

BTW, please enclose your code snippets in [code] [/code] tags. It helps breaking things up to make it easier to read. Thanks.


Adrian
Feb 6 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steven O. | last post by:
First, sorry if by some chance I am not posting to the correct newsgroups, these seemed to be the most applicable to my question (see disclaimer at end of post for further comments....). Started...
3
by: Lorenzo Polidori | last post by:
Hi all, I have to display an MPEG2 stream in my C++ application. I have seen the Media Player Object of Borland C++Builder 6 can have as input a file specified in Filename property of this media...
11
by: TGF | last post by:
I am wondering if it is feasible to use .NET for applications that have to be very fast. We have a few applications that are blazingly fast, written in Borland C++ using Borland C++ Builder. We...
17
by: Ziggi | last post by:
Hi. I want to get a C++ IDE, but I dont know whether to go for Bill Gate's solution or Borland's. Could any kind folks detail the relative strength and weaknesses of both, and also tell me which...
15
by: Chris | last post by:
I am just beginning programming again and need a bit of advice. I have both Visual C++ 6.0 Standard Edition and Borland C++ Builder 6. Of these two which do you consider the best for programming...
9
by: Christo | last post by:
hey im a student about to start a course in c++ at uni, we have been told to obtain a copy of borland c++ 5.01 (not c++ builder) this is just a program with a compiler/linker and development...
24
by: serdar | last post by:
Hi. Does anybody say that what is better borland c++ or visual c++? Which compiler does have more help?
0
by: Xproblem | last post by:
FTP Client Engine for C/C++ 2.4 Screenshot - Soft.comFTP Client Engine for C/C++ 2.4. ... System Requirements: Windows C/C++ compiler - Microsoft operating system: Windows 95, Windows 98, Windows...
22
by: smartwolf agassi via DotNetMonster.com | last post by:
I'm a C# language learner. I want to know which IDE is better for C# programing, Borland C#Builder or VS.net 2003? -- Message posted via http://www.dotnetmonster.com
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.