inherit from TsPanel

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #33703
    ErmandoFerrari
    Participant

    I try to inherit a component from TsPanel, but the result is a linker error:

    [Linker Error] Unresolved external '__fastcall Spanel::TsPanel::PaintWindow(void *)' referenced from C:testMYPANEL.OBJ
    [Linker Error] Unresolved external '__fastcall Spanel::TsPanel::OurPaint(void *, bool)' referenced from C:testMYPANEL.OBJ
    [Linker Error] Unresolved external '__fastcall Spanel::TsPanel::WriteText(const Types::TRect&, Graphics::TCanvas *, void *)' referenced from C:testMYPANEL.OBJ

    any idea?

    Thank you

    #42334
    ErmandoFerrari
    Participant

    I am using BCB6

    #42362
    Support
    Keymaster

    I'm sorry, I haven't big experience in work with Builder, but I think, you have a standard error of modules linking.
    You have searched “Unresolved external” in the Net?
    Some links :
    http://www.youtube.com/watch?v=gbRcZho2SvY
    http://bytes.com/topic/c/answers/512820-li…-builder-2006-a
    http://webcache.googleusercontent.com/sear…;client=firefox

    #42364
    ErmandoFerrari
    Participant

    of course is a link error, that mean that the function is defined (in header) but not implemented in library
    I haven't experience with delphi but having a look in sPanel.pas I havn't find the implementation of that functions… look like the “pure virtual” functions in C++

    For now I have implemented the functions in my inherited class:

    class PACKAGE TMyPanel : public TsPanel
    {

    protected:
    virtual void __fastcall PaintWindow(void* hdc){TPanel::PaintWindow(hdc);};
    virtual void __fastcall OurPaint(void *hdc,bool){TPanel::PaintWindow(hdc);};
    virtual void __fastcall WriteText(const Types::TRect &R, Graphics::TCanvas* aCanvas = (Graphics::TCanvas*)(0x0), HDC aDC = (HDC)(0x0)){};

    }

    it's work, but my panel don't skin…

    My task is to create a component that “aggregate” other control ( a button, a treeview and a memo) into a single component, so I derived a TsPanel and dynamically create the tree components inside it. If you have a better idea for a base class other than TsPanel (possibly transparent) my problem it solved

    #42365
    Support
    Keymaster

    QUOTE (ErmandoFerrari @ Apr 27 2010, 04:37 PM) <{POST_SNAPBACK}>
    I haven't experience with delphi but having a look in sPanel.pas I havn't find the implementation of that functions… look like the “pure virtual” functions in C++


    No, implementation of these functions is existing there..
    PaintWindow implemented in the line №265
    OurPaint – 164
    WriteText – 474

    #42372
    ErmandoFerrari
    Participant

    DONE!!!

    #42429
    Support
    Keymaster

    Hello
    Thank you for researching, this topic will be moved to “tricks” soon. I think, your information will be useful for others.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.