Re: Global class problem

From: Maarten Wiltink (maarten_at_kittensandcats.net)
Date: 11/11/04


Date: Thu, 11 Nov 2004 22:26:03 +0100


"Peter Piper" <NoEmail@Email.com> wrote in message
news:cn0bao$fl6$2@hercules.btinternet.com...
> Maarten Wiltink wrote:
>> "Peter Piper" <NoEmail@Email.com> wrote in message
>> news:cmvtjg$1kr$1@sparta.btinternet.com...

>> <Singleton>
>>
>>> What am i doing wrong, do i need to initialize the variable first?
>>
>> You do. Who else are you expecting to do it, and why?

> OK how do I initialize the variable, do you mean call Create as Dug
> pointed out?
> And if so where do i call this from, i remember reading that a unit can
> have an initialization section.??

Ekkehard already gave the answer you need to get it working. I'm only
trying to create understanding (it's a thankless job, making people
think for themselves).

The point is that the call to Create is what causes memory to be
allocated and "filled in" as an object, any object. No call to a
constructor, no object. It doesn't happen by itself. (In other
languages it does. This creates its own problems.)

Groetjes,
Maarten Wiltink



Relevant Pages

  • Re: Global class problem
    ... Who else are you expecting to do it, ... Groetjes, ... Maarten Wiltink ...
    (alt.comp.lang.borland-delphi)
  • Re: calling application procedure from a dll
    ... > Using FastMM instead of ShareMem allows you to have a shared memory ... > manager without having to include a separate memory-manager DLL. ... the modules still have separate class references. ... Maarten Wiltink ...
    (comp.lang.pascal.delphi.misc)
  • Re: D5 Constant expression expected
    ... At 12:26:25, 18.04.2004, Maarten Wiltink wrote: ... > (stored in memory) values of typed constants to be changed. ... Rudy Velthuis ...
    (comp.lang.pascal.delphi.misc)
  • Re: Owner Draw of ComboBox Text & Items
    ... In article, "Maarten Wiltink" ... long ago memory that I saw the statement that Marlett _was_ used as the source ... Alan Lloyd ...
    (comp.lang.pascal.delphi.misc)