Board index » cppbuilder » Initialization of a Delphi unit

Initialization of a Delphi unit


2004-05-22 01:10:58 AM
cppbuilder85
Hello there.
I have a series of delphi units that I need to be initializated before
anything, as they are a Memory Manager and, if they are just linked to the
project (adding the pas sources) the memmanager doesn't get changed at the
right time, so things get created with the default MM and then tryed to free
from the new Memory Manager. One of this unit implements a call to
SetMemoryManager, in it's initialization section.
Any idea of how to solve this?
--
Rodrigo Gómez
rgomez.msa.com.mx/gallery/
 
 

Re:Initialization of a Delphi unit

I tried one once. It would take over all memory allocations happening from
the unit it was included and down. If this was not the top level unit a flag
needed to be raized for it to co-exists with borlands memory mananger.
In other words if it was included in the project source (project -->view
source) and had it path-nmes added in front of the search path (project
options) it worked without needing to co-exists.
I hope it helps.
/palle
 

Re:Initialization of a Delphi unit

Good to know, I hope it also work for your real program. My program was a
mixed C++/Pascal program and it worked all the way. But it didn't solve my
problem which turned out to be caused by some range-errors :-/
The one I tested had it's description in the source file, telling which
lines to re/un-mark for setting various options. In case you encounter any
problems.
/Palle
"Rodrigo Gómez" < XXXX@XXXXX.COM >skrev i en meddelelse
Quote
>In other words if it was included in the project source (project -->
view
>source) and had it path-nmes added in front of the search path (project
>options) it worked without needing to co-exists.

Amazing... it works... at least on BCB6, and a very simple project.

I fear that this might change in another enviroment/project, but, well...
at
least the simple test app that failed now works, no AV at the end.

Thank you very much!

--
Rodrigo Gómez
rgomez.msa.com.mx/gallery/



 

{smallsort}

Re:Initialization of a Delphi unit

Thanks for the tip, I'll try it. I think I have already done that, but
anyway, it worths checking it.
--
Rodrigo Gómez
rgomez.msa.com.mx/gallery/
"Palle Meinert" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
I tried one once. It would take over all memory allocations happening from
the unit it was included and down. If this was not the top level unit a
flag
needed to be raized for it to co-exists with borlands memory mananger.

In other words if it was included in the project source (project -->view
source) and had it path-nmes added in front of the search path (project
options) it worked without needing to co-exists.

I hope it helps.

/palle


 

Re:Initialization of a Delphi unit

Quote
In other words if it was included in the project source (project -->view
source) and had it path-nmes added in front of the search path (project
options) it worked without needing to co-exists.
Amazing... it works... at least on BCB6, and a very simple project.
I fear that this might change in another enviroment/project, but, well... at
least the simple test app that failed now works, no AV at the end.
Thank you very much!
--
Rodrigo Gómez
rgomez.msa.com.mx/gallery/
 

Re:Initialization of a Delphi unit

Well... it works fine with BCB6, as far as I can see, but not with BCB5.
I'm compiling right now a bigger project for BCB6, but I think that your
solution will work fine... I hope so!
Regards,
--
Rodrigo Gómez
rgomez.msa.com.mx/gallery/
"Palle Meinert" < XXXX@XXXXX.COM >escribi?en el mensaje
Quote
Good to know, I hope it also work for your real program. My program was a
mixed C++/Pascal program and it worked all the way. But it didn't solve my
problem which turned out to be caused by some range-errors :-/

The one I tested had it's description in the source file, telling which
lines to re/un-mark for setting various options. In case you encounter any
problems.

/Palle

"Rodrigo Gómez" < XXXX@XXXXX.COM >skrev i en meddelelse
news: XXXX@XXXXX.COM ...
>>In other words if it was included in the project source (project -->
view
>>source) and had it path-nmes added in front of the search path
(project
>>options) it worked without needing to co-exists.
>
>Amazing... it works... at least on BCB6, and a very simple project.
>
>I fear that this might change in another enviroment/project, but,
well...
at
>least the simple test app that failed now works, no AV at the end.
>
>Thank you very much!
>
>--
>Rodrigo Gómez
>rgomez.msa.com.mx/gallery/
>
>
>