473,406 Members | 2,633 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,406 software developers and data experts.

Error Using FormDestroy method in Borland C++ 6.0

Hi,

I'm developing a database application using Borland C++ 6.0.
In one of the form the application throws an error when exiting
because of the following peace of code.when code inside the function
is removed it works perfectly.
void __fastcall Tf_ftp::FormDestroy(TObject *Sender)
{
AddToLog(Memo1->Lines);
}

The FormDestroy method is called when MainForm tries to destroy a
module in the application.
The troublesome code works perfectly elsewhere.

Please throw some light on FormDestroy function and it's handling.

Regards,

Deepak
Jul 22 '05 #1
2 1845
de**********@yahoo.co.in wrote:
Hi,

I'm developing a database application using Borland C++ 6.0.
In one of the form the application throws an error when exiting
because of the following peace of code.when code inside the function
is removed it works perfectly.
void __fastcall Tf_ftp::FormDestroy(TObject *Sender)
{
AddToLog(Memo1->Lines);
}

The FormDestroy method is called when MainForm tries to destroy a
module in the application.
The troublesome code works perfectly elsewhere.

Please throw some light on FormDestroy function and it's handling.

Regards,

Deepak


You will have to ask in a Borland newsgroup, as this newsgroup
is only concerned with _standard_ C++ which has no knowledge
of the FormDestroy function.

How scary, the operating system can destroy modules in an
application!

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #2
On 23 Jun 2004 06:16:31 -0700, de**********@yahoo.co.in wrote:
Hi,

I'm developing a database application using Borland C++ 6.0.
In one of the form the application throws an error when exiting
because of the following peace of code.when code inside the function
is removed it works perfectly.
void __fastcall Tf_ftp::FormDestroy(TObject *Sender)
{
AddToLog(Memo1->Lines);
}

The FormDestroy method is called when MainForm tries to destroy a
module in the application.
The troublesome code works perfectly elsewhere.

Please throw some light on FormDestroy function and it's handling.

Regards,

Deepak


This is a VCL-related problem of order of construction/destruction.
The quick answer is: do not use FormDestroy for anything that needs
access to any members of your class, especially other VCL objects.
They have already gone by the time FormDestroy() is called. Use
OnClose() or the destructor of your form's class.

VCL doesn't follow the rules of C++.

--
Bob Hairgrove
No**********@Home.com
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
4
by: viv_men | last post by:
hi, i have implemented a base class and a derived class as follows base : beziertriangle .h and beziertriangle .cpp derived: PNpatch.h and PNpatch.cpp when i compile them it works out fine ,...
8
by: Vavel | last post by:
Hi all! I used google, but I found nothing. I have got smiple code: #include <sql.h> int main() { } when I compiled this in Borland C++ 5.5.1 for Win32 Copyright (c) 1993,
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
5
by: Andrew S. Giles | last post by:
I thought I would post here, as I am sure someone, somewhere has run into this problem, and might have a good solution for me. I am writing an applicaiton in C# that will accept data and then put...
6
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...
12
by: kath.neumann | last post by:
Hi, I just started to get a grip on C++ and and went through the tutorial. However, not even the standard "hello world" exercise works out :( I do get a linker error " Unresolved external...
1
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- ...
12
by: jonatan | last post by:
Hello All, I am making a program and need the grt_main.c but i try to compile have the error c1004.Please help me how to solve it? Thank you. --------------------Configuration: pre - Win32...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.