Windows

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • D7 compiler trouble

    6 answers - 1205 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    23-Dec-05 18:57:05 Arno Garrels wrote:

    >Maurizio Lotauro wrote:

    []

    >But that error is on a dialog box instead on the message windows. In this
    >case TForm1 is used in the dfm so probaly the compiler doesn't like the
    >define "around" cleass declaration.
    >>

    >I'm still using D5.


    >I tried it with D5, it is the same as in D7.

    I'm trying something that is not possible :(
    I think that the problem is the IDE, not the compiler, because
    probably it doesn't take into account the conditionals. This explain
    why the error message is in a dialog box instead in the message
    window. So it should compile outside Delphi, but not very
    confortable.
    Try this:
    type
    TMyForm = class(TForm);
    {$IFDEF TEST}
    TMyParentForm = TForm;
    {$ELSE}
    TMyParentForm = class(TMyForm);
    {$ENDIF}
    TForm1 = class(TMyParentForm)
    private
    { Private-Deklarationen }
    public
    { Public-Deklarationen }
    end;
    This doesn't raise any error :-)
    Bye, Maurizio.
  • No.1 | | 1888 bytes | |

    Thanks, that works. I found several other places where those declarations
    are used. So it's not T. For instance:

    {$IFDEF USE_SSL}
    THttpConnection = class(TSslWSocketClient)
    {$ELSE}
    THttpConnection = class(TWSocketClient)
    {$ENDIF}

    All those declarations cause the IDE to display an additional
    private var, here THttpConnection in the object inspector.

    If you change it to:

    {$IFDEF USE_SSL}
    TBaseHttpConnection = TSslWSocketClient;
    {$ELSE}
    TBaseHttpConnection = TWSocketClient;
    {$ENDIF}
    THttpConnection = class(TBaseHttpConnection)

    it makes the IDE happy. However lists TBaseHttpConnection
    under Types of course.

    Francois, what do you think?

    Maurizio Lotauro wrote:
    23-Dec-05 18:57:05 Arno Garrels wrote:

    >Maurizio Lotauro wrote:


    []

    But that error is on a dialog box instead on the message windows. In
    this case TForm1 is used in the dfm so probaly the compiler doesn't
    like the define "around" cleass declaration.

    I'm still using D5.

    >I tried it with D5, it is the same as in D7.
    >I'm trying something that is not possible :(


    I think that the problem is the IDE, not the compiler, because
    probably it doesn't take into account the conditionals. This explain
    why the error message is in a dialog box instead in the message
    window. So it should compile outside Delphi, but not very
    confortable.

    Try this:

    type
    TMyForm = class(TForm);

    {$IFDEF TEST}
    TMyParentForm = TForm;
    {$ELSE}
    TMyParentForm = class(TMyForm);
    {$ENDIF}

    TForm1 = class(TMyParentForm)
    private
    { Private-Deklarationen }
    public
    { Public-Deklarationen }
    end;

    This doesn't raise any error :-)

    Bye, Maurizio.
  • No.2 | | 791 bytes | |

    Thanks, that works. I found several other places where those declarations
    are used. So it's not T. For instance:

    {$IFDEF USE_SSL}
    THttpConnection = class(TSslWSocketClient)
    {$ELSE}
    THttpConnection = class(TWSocketClient)
    {$ENDIF}

    All those declarations cause the IDE to display an additional
    private var, here THttpConnection in the object inspector.

    If you change it to:

    {$IFDEF USE_SSL}
    TBaseHttpConnection = TSslWSocketClient;
    {$ELSE}
    TBaseHttpConnection = TWSocketClient;
    {$ENDIF}
    THttpConnection = class(TBaseHttpConnection)

    it makes the IDE happy. However lists TBaseHttpConnection
    under Types of course.

    Francois, what do you think?

    What do you mean by "lists TBaseHttpConnection under Types" ?
  • No.3 | | 1035 bytes | |

    Francois PIETTE wrote:
    >Thanks, that works. I found several other places where those declarations
    >are used. So it's not T. For instance:
    >
    >{$IFDEF USE_SSL}
    >THttpConnection = class(TSslWSocketClient)
    >{$ELSE}
    >THttpConnection = class(TWSocketClient)
    >{$ENDIF}
    >
    >All those declarations cause the IDE to display an additional
    >private var, here THttpConnection in the object inspector.
    >If you change it to:
    >
    >{$IFDEF USE_SSL}
    >TBaseHttpConnection = TSslWSocketClient;
    >{$ELSE}
    >TBaseHttpConnection = TWSocketClient;
    >{$ENDIF}
    >THttpConnection = class(TBaseHttpConnection)
    >
    >it makes the IDE happy. However lists TBaseHttpConnection
    >under Types of course.
    >
    >Francois, what do you think?


    What do you mean by "lists TBaseHttpConnection under Types" ?

    New type TBaseHttpConnection would be listed by the object inspector
    under section Types.
  • No.4 | | 1221 bytes | |

    Arno Garrels wrote:
    Francois PIETTE wrote:
    Thanks, that works. I found several other places where those
    declarations are used. So it's not T. For instance:

    {$IFDEF USE_SSL}
    THttpConnection = class(TSslWSocketClient)
    {$ELSE}
    THttpConnection = class(TWSocketClient)
    {$ENDIF}

    All those declarations cause the IDE to display an additional
    private var, here THttpConnection in the object inspector.
    If you change it to:

    {$IFDEF USE_SSL}
    TBaseHttpConnection = TSslWSocketClient;
    {$ELSE}
    TBaseHttpConnection = TWSocketClient;
    {$ENDIF}
    THttpConnection = class(TBaseHttpConnection)

    it makes the IDE happy. However lists TBaseHttpConnection
    under Types of course.

    Francois, what do you think?
    >
    >What do you mean by "lists TBaseHttpConnection under Types" ?


    New type TBaseHttpConnection would be listed by the object inspector
    under section Types.

    Stupid, I was always talking about the object inspector but ment the project
    management window sorry.


    >--
    >francois.piette (AT) overbyte (DOT) be
    >http://www.overbyte.be
  • No.5 | | 448 bytes | |

    What do you mean by "lists TBaseHttpConnection under Types" ?
    >>

    >New type TBaseHttpConnection would be listed by the object inspector
    >under section Types.
    >

    Stupid, I was always talking about the object inspector but ment the
    project
    management window sorry.

    I still don't understand. ! Is it "code explorer" window ?
    Capture a print screen.
  • No.6 | | 752 bytes | |

    Francois PIETTE wrote:
    What do you mean by "lists TBaseHttpConnection under Types" ?

    New type TBaseHttpConnection would be listed by the object inspector
    under section Types.
    >
    >Stupid, I was always talking about the object inspector but ment the
    >project
    >management window sorry.


    I still don't understand. ! Is it "code explorer" window ?
    Capture a print screen.

    Today, Christmas 2005 I learned how to name this strange window on the left
    I've been working with since years now, wow!

    Attached screenshot demonstrates the issue.
    Note how TMyFirstList and TMySecondList are displayed in the Code Explorer
    (or should I better say on the left?).

Re: D7 compiler trouble


max 4000 letters.
Your nickname that display:
In order to stop the spam: 6 + 5 =
QUESTION ON "Windows"

EMSDN.COM