Board index » cppbuilder » Delphi.Initialization->CPP?

Delphi.Initialization->CPP?


2006-03-20 07:34:39 PM
cppbuilder95
Hello,
I am trying to use some Delphi components which rely on some registration routines being run in the initialization section of an Object Pascal unit.
What is the equivalent cpp mechanism please?
Best Regards, Paul.
 
 

Re:Delphi.Initialization->CPP?

Hi Vavan,
Thanks for the reply.
Quote
On 20 Mar 2006 04:34:39 -0700, "guest" XXXX@XXXXX.COM wrote:

>I am trying to use some Delphi components which rely on some registration routines being run in the initialization section of an Object Pascal>unit.

if you're going to use corresponding delphi unit 'as is' in your
project then you don't need to worry at all since initialization
section should execute automatically. at least this is how it worked
in bcb5, not sure if bds changed something
It's in their test harness. Yes, I am working on a pure cpp version of their test harness
but I have junked their inherited form which is where the initialisation is taking place.
I missed this and it wasn't working at all. Now it is 'sort of working' - I put the routines
in the OnCreate of the main form.
Quote
>What is the equivalent cpp mechanism please?

I believe there is no pure c++ equivalent but for bcb have a look at
#pragma startup/exit
I will, thanks for this.
Best Regards, Paul.
 

Re:Delphi.Initialization->CPP?

On 20 Mar 2006 04:34:39 -0700, "guest" XXXX@XXXXX.COM wrote:
Quote
I am trying to use some Delphi components which rely on some registration routines being run in the initialization section of an Object Pascal unit.
if you're going to use corresponding delphi unit 'as is' in your
project then you don't need to worry at all since initialization
section should execute automatically. at least this is how it worked
in bcb5, not sure if bds changed something
Quote
What is the equivalent cpp mechanism please?
I believe there is no pure c++ equivalent but for bcb have a look at
#pragma startup/exit
--
Vladimir Ulchenko aka vavan
 

{smallsort}

Re:Delphi.Initialization->CPP?

Hi Gambit,
Quote
"guest" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>I put the routines in the OnCreate of the main form.
I lied :-) I put them in the constructor.
Quote
Do not use the OnCreate event in C++! It is a Delphi idiom that produces
illegal behavior in C++ as it can be triggered before the constructor. Use
the actual constructor instead.
I didn't know this - thanks.
Best Regards, Paul.
 

Re:Delphi.Initialization->CPP?

"guest" < XXXX@XXXXX.COM >wrote in message
Quote
I put the routines in the OnCreate of the main form.
Do not use the OnCreate event in C++! It is a Delphi idiom that produces
illegal behavior in C++ as it can be triggered before the constructor. Use
the actual constructor instead.
Gambit