Board index » cppbuilder » Property OldCreateOrder from TForm : it does'nt save its value (in dfm)

Property OldCreateOrder from TForm : it does'nt save its value (in dfm)

Hello,

I've ported a BCB3 project to BCB4, and set manually all properties
OldCreateOrder to 'false'. But when I reload the project (after a
shutdown from BCB4), the property OldCreateOrder has again the value
'true'. I set again the value to 'false', save the form and whole
project, close the IDE, restrat and reload the project : the value is
'true'.

Why does the IDE change the value of properties ?

Thanks for any help.

Didier Kuttel

 

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Quote
Didier Kuttel wrote:

> I've ported a BCB3 project to BCB4, and set manually all properties
> OldCreateOrder to 'false'. But when I reload the project (after a
> shutdown from BCB4), the property OldCreateOrder has again the value
> 'true'.

Are you using form inheritance via the object repository? If so, make
sure you set it to false in the base form as well.

Harold Howe [TeamB]
http://www.bcbdev.com

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Quote
"Harold Howe [TeamB]" wrote:

> Didier Kuttel wrote:

> > I've ported a BCB3 project to BCB4, and set manually all properties
> > OldCreateOrder to 'false'. But when I reload the project (after a
> > shutdown from BCB4), the property OldCreateOrder has again the value
> > 'true'.

> Are you using form inheritance via the object repository? If so, make
> sure you set it to false in the base form as well.

> Harold Howe [TeamB]
> http://www.bcbdev.com

Yes, I use inheritance and the property from superclass is set to
'false' (and stay false when reloading the whole project).

Didier Kuttel

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Quote
On Mon, 30 Aug 1999 16:21:46 +0200, Didier Kuttel <d...@wag.ch> wrote:
>"Harold Howe [TeamB]" wrote:

>> Didier Kuttel wrote:

>> > I've ported a BCB3 project to BCB4, and set manually all properties
>> > OldCreateOrder to 'false'. But when I reload the project (after a
>> > shutdown from BCB4), the property OldCreateOrder has again the value
>> > 'true'.

>> Are you using form inheritance via the object repository? If so, make
>> sure you set it to false in the base form as well.

>> Harold Howe [TeamB]
>> http://www.bcbdev.com

>Yes, I use inheritance and the property from superclass is set to
>'false' (and stay false when reloading the whole project).

Override the Loaded() method of the base form to read something like:

void TFormBase::Loaded (void)
{
        TForm::Loaded();
        OldCreateOrder = false;

Quote
}

I've posted this workaround for the bug again and again when I've seen someone
have this problem, but it doesn't seem to have got through to Team B yet.<s>

Pete Barrett

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


i reported this in a bug to Borland a couple of months ago and got a
response that the tester reproduced the problem.  Hopefully there will be
another patch.  If not it should be fixed in  BCB5. :)

Matt Lee
kat...@ntr.net
http://www.ntr.net/~kateel

Quote

> Yes, I use inheritance and the property from superclass is set to
> 'false' (and stay false when reloading the whole project).

> Didier Kuttel

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Hi, Didier!

I believe if you move your code in the OnCreate to the constructor
(which is where it really belongs), OldCreateOrdr doesn't matter.

It's a pain, but its a good idea.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


If you have no time... to rewrite you appl. with new OldCreateOrder,- you
can avoid this problem ( but for static linking only...sorry...) :
Problem:
    - OldCreateOrder not saved in child's forms and TDataMidule too...
    - I'm not know about this before...and now too...But my BCB3 project not
working...

1. Open you forms.hpp file from $(BCB)\include\vcl in any ediitor
2. Find TDataModule class declaration and add this lines :
protected:
 virtual void __fastcall Loaded(void);
3. Create new Patch.cpp file in any project with whis lines and compile it:

patch.h :

#ifndef patchH
#define patchH
#endif

patch.cpp:

#include <vcl.h>
#pragma hdrstop

#include "patch.h"
#include <forms.hpp>

void __fastcall TCustomForm::Loaded()
{
    TWinControl *Control ;

    TScrollingWinControl::Loaded() ;
    OldCreateOrder=false ;
    if( ActiveControl ){
        Control = ActiveControl ;
        FActiveControl = NULL ;
        if( Control->CanFocus() ) SetActiveControl(Control) ;
    }

Quote
}

void __fastcall TDataModule::Loaded()
{
    TComponent::Loaded() ;
    OldCreateOrder=false ;
Quote
}

#pragma package(smart_init)

3. Copy patch.obj in $(BCB)\lib\obj direcory
4. Open you project, - view makefile,- add to the END of SPARELIBS section
patch.obj.
5. Build you project and forget about OldCreateOrder.

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Hi, Dmitri!

It is better to avoid using OnCreate and to move that code to the
constructor ASAP.

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Hi Mark!

You find the better solution. Thank's !

Only small problem.... Are you have any time to rewrite you old projects ???
And are you boss pay any money for this works ????? :-))

Maybe in any time SurPrise changed something another..... ? :-)

P.S.
Sorry for nigth time, but I'm writing this message in 12.10 in Moscow... but
my server sent this message in smaller money time.

Re:Property OldCreateOrder from TForm : it does'nt save its value (in dfm)


Hi, Dmitri!

Yes, I get paid for improving my software as part of the maintenance
process. My management understands this is in the best interest of the
company.

If that was your question...

------
Mark Cashman (TeamB - C++ Builder), creator of The Temp{*word*203}Doorway at
http://www.temporaldoorway.com
- Original digital art, writing, music and more -
C++ Builder / JBuilder Tips and The C++ Builder Programmer's Webring
(Join us!)
http://www.temporaldoorway.com/programming/index.htm
------

Other Threads