Re: Is it possible to cancel a destruction ?



Well I was curious if my SkybuckRTL ;) would work lol so I simply placed
"temp" in front of this line in the library path:

temp $(DELPHI)\Lib

So that it gets invalidated/not used ;)

and added a path to my SkybuckRTL ;)

The following console program "amazingly" enough compiles/builds and
executes just fine =D

It's quite simply so apperently the RTL is enough to compile and build it...
as soon as this example would start using vcl stuff it would probably not
compile anymore.

To test this theory I also just created a new application and mixed the
complete delphi lib folder with my skybuck rtl folder to see what would
happen.

"Amazingly" enough delphi detects that the vcl was compiled with a different
rtl version ? hmm well not really it complains about a different version of
safe call exception stuff... a bit weird I dont know why that is... why
doesnt it say something like: "different rtl version detected" or so :)

[Fatal Error] Project1.dpr(5): Unit Forms was compiled with a different
version of System.TObject.SafeCallException

So I guess every DCU in the lib path would need to be recompiled to make
everything work splended together... So this probably means... the VCL has
to be re-compiled and god knows what else ;)

Maybe simply the whole source folder of delphi. Hmm however.. the main
source folder doesn't have a make file... hmmm. The VCL folder also doesn't
have a make file... Gje me wonders how te re-compile all this stuff if
needed at all ;) <- probably needed though. Well I'll google later for now
here is the funny new source/example hehehehehe:


Had to solve a little namespace conflict though, since I wanted a property
to be able to change if destroy is allowed or not ;)

program Project1;

{$APPTYPE CONSOLE}

uses
SysUtils;


type
TtestObject = class(Tobject)
private
mDestroyAllowed : boolean;

public
function DestroyAllowed : boolean; override;

property PropertyDestroyAllowed : boolean read mDestroyAllowed write
mDestroyAllowed;
end;

function TtestObject.DestroyAllowed : boolean;
begin
result := false;

if inherited DestroyAllowed then
begin
if mDestroyAllowed then
begin
result := true;
end;
end;
end;

var
vTestObject : TtestObject;

begin
vTestObject := TtestObject.Create;


vTestObject.PropertyDestroyAllowed := false;

if vTestObject.Free then
begin
writeln('object was freeed');
end else
begin
writeln('object was not freeed');
end;

vTestObject.PropertyDestroyAllowed := true;

if vTestObject.Free then
begin
writeln('object was freeed');
end else
begin
writeln('object was not freeed');
end;

readln;

end.


Bye,
Skybuck, woeh ;)

"Skybuck Flying" <nospam@xxxxxxxxxxx> wrote in message news:...
> Hmm changing system.pas and thereby delphi a little bit is quite
interesting
> ;)
>
> I googled how to do this and I found some post describing this:
>
> "
> You can compile it from the command line. Copy the entire RTL section of
> the source to a separate place and use the makefile to recompile it.
> "
>
> Here are the steps I took to make this happen ;)
>
> 1. Copy the RTL section to folder X
>
> 2. The make file requires TASM 4.0 so "get" ;) TASM 5.0 install it and
apply
> the patch as well just in case ;)
>
> 3. Create two extra folders in folder X called "bin" and "lib" these
folders
> will be the output folders.
>
> 4. Run make, sit back and enjoy the fun show of some hints and warnings
lol.
>
> And voila compiled units located in the lib folder all nice dcu files =D
;)
>
> Except now I have the same old nagging fucking problem:
>
> I would only like to use these special dcu's for special projects etc ;)
So
> I would like to be able to set the library path in the project options...
> unfortunately enough the project options don't have the library paths
etc...
>
> The environment settings control/have the library paths... which means
> changing these settings changes all projects etc... which I
> absoluuuuuuuuuutely dont want ;)
>
> The question is now how do I solve this problem...
>
> 1. Maybe I can create a special desktop environment ?
>
> 2. Maybe I can set the library paths in the project file via some compiler
> options ?
>
> Shitty ;)
>
> Bye,
> Skybuck =D:P*wieeeeeeeeeee ;)
>
>


.