Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

How to resolve Linker Error when Making a new component based on TLMDListBox ?

Hi,

I'm using C++Builder 2007 with LMD-Tools 11 and when I'm making a new component with TLMDListBox as ancestor, I have the following linker error:

[ILINK32 Error] Error: Unresolved external '__fastcall Lmdcustomscrollbox::TLMDCustomScrollBox::PaintWindow(HDC__ *)' referenced from MyListBox.OBJ

How can I resolve that ?

The ultimate goal of doing that is to make this control works with CodeBear TestComplete, by integrating MSAA or by exposing some new properties in order to query the current selection (If some one has hint about that, I would be happy to hear about it).

Comments

  • 4 Comments sorted by Votes Date Added
  • Hi,

    there are two possible ways:
    1.) Either fix issue (e.g. for fixing problems with HDC parameters), for example research on Google like
    or (most often the much faster and simpler method)
    2.) when you don't rely on this method in your descendant, simply remove the declaration in header file.

  • Thank you for your quick answer.

    I'm already compiling using the STRICT define (if I use NO_STRICT it doesn't work either).

    Error With Strict Define: 
    [ILINK32 Error] Error: Unresolved external '__fastcall Lmdcustomscrollbox::TLMDCustomScrollBox::PaintWindow(HDC__ *)' referenced from MDLISTBOX3.OBJ

    Error with NO_STRICT:
    [ILINK32 Error] Error: Unresolved external '__fastcall Lmdcustomscrollbox::TLMDCustomScrollBox::PaintWindow(void *)' referenced from LMDLISTBOX3.OBJ

    I don't have the PainWindow method defines in my class.

    All I've done is to create a new Component with a TLMDListBox as ancestor and try to compile it as is. It just doesn't link,

    Here's the code:

    TLMDListBox3.h
    //---------------------------------------------------------------------------

    #ifndef LMDListBox3H
    #define LMDListBox3H
    //---------------------------------------------------------------------------
    #include <SysUtils.hpp>
    #include <Classes.hpp>
    #include "LMDCustomScrollBox.hpp"
    #include "LMDListBox.hpp"
    #include <Controls.hpp>
    #include <Forms.hpp>
    //---------------------------------------------------------------------------
    class PACKAGE TLMDListBox3 : public TLMDListBox
    {
    private:
    protected:
    public:
        __fastcall TLMDListBox3(TComponent* Owner);
    __published:
    };
    //---------------------------------------------------------------------------
    #endif

    TLMDListBox3.cpp
    //---------------------------------------------------------------------------

    #include <vcl.h>

    #pragma hdrstop

    #include "LMDListBox3.h"
    #pragma link "LMDCustomScrollBox"
    #pragma link "LMDListBox"
    #pragma package(smart_init)
    //---------------------------------------------------------------------------
    // ValidCtrCheck is used to assure that the components created do not have
    // any pure virtual functions.
    //

    static inline void ValidCtrCheck(TLMDListBox3 *)
    {
        new TLMDListBox3(NULL);
    }
    //---------------------------------------------------------------------------
    __fastcall TLMDListBox3::TLMDListBox3(TComponent* Owner)
        : TLMDListBox(Owner)
    {
    }
    //---------------------------------------------------------------------------
    namespace Lmdlistbox3
    {
        void __fastcall PACKAGE Register()
        {
             TComponentClass classes[1] = {__classid(TLMDListBox3)};
             RegisterComponents("Samples", classes, 0);
        }
    }
    //---------------------------------------------------------------------------

    Does anybody have a clue about what is my problem ?
  • Hi,

    >>I don't have the PainWindow method defines in my class.<<
    As said in previous message:
    Remove from the offending header file, here Lmdcustomscrollbox.


Sign In or Register to comment.