Results 1 to 4 of 4

Thread: How To Extend Stingray Classes?

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    16

    How To Extend Stingray Classes?

    Uhm , I don't know if the title is correct, but recompiling our code, I've found this problem two times:
    If I create a class that "extend" a SEC button of Toolkit, in declaration I set the TOOLKIT_DECLARE_BUTTON, in implementation the TOOLKIT_IMPLEMENT_BUTTON, I'll have this error on linker:

    ComboBtn.obj : error LNK2001: unresolved external symbol "public: virtual struct SECButtonClass * __thiscall SECComboBtn::GetButtonClass(void)const " (?GetButtonClass@SECComboBtn@@UBEPAUSECButtonClass @@XZ)

    I think that the problem is in TOOLKIT_DECLARE_BUTTON macro, where the definition of GetButtonClass don't have the TOOLKIT_API macro setted.

    Or...maybe I wrong the method of extending Stingray Classes?

  2. #2
    Junior Member
    Join Date
    Oct 2008
    Posts
    1
    I'm having exactly the same problem, can anyone help or did you manage to resolve it nicjedi?

  3. #3
    Junior Member
    Join Date
    Mar 2008
    Posts
    16
    If you are using Stingray Studio 2006 v3 or later, try the suggestions found in section 3.5.2 "Using CustExtDefs.h in Stingray Extensions" of the Getting Started User's Guide (CHM format) or integrated into the MSVCC or MSDN Help collection.

    Using the libraries macros to extend the library functionality will just confuse the library decl_spec. Using custom extension definitions in your extenstions, rather than the predefined library macro definitions, should resolve this issue.

  4. #4
    Junior Member
    Join Date
    Mar 2008
    Posts
    16
    There is a bug which has been fixed for the upcoming SS10.1 release. The TOOLKIT_API macro was missing from the TOOLKIT_DECLARE_BUTTON macro. TOOLKIT_DECLARE_BUTTON and TOOLKIT_IMPLEMENT_BUTTON should be defined as follows:
    #define TOOLKIT_DECLARE_BUTTON(class_name) \
    public: \
    static const AFX_DATA SECButtonClass class##class_name; \
    TOOLKIT_API virtual SECButtonClass* GetButtonClass() const; \
    TOOLKIT_API static SECStdBtn* PASCAL CreateButton();
    #define TOOLKIT_IMPLEMENT_BUTTON(class_name) \
    SECStdBtn* PASCAL class_name::CreateButton() \
    { return new class_name; } \
    const AFX_DATADEF SECButtonClass class_name::class##class_name = { \
    class_name::CreateButton }; \
    SECButtonClass* class_name::GetButtonClass() const \
    { return ((SECButtonClass*)(&class_name::class##class_name) ); } \

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •