Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What is the intention of making these methods mandatory while creating COM object in QT.
QtWS25 Last Chance

What is the intention of making these methods mandatory while creating COM object in QT.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    feedmeqt
    wrote on last edited by
    #1

    Hi,

    I've created some COM object based on the post "11533":http://developer.qt.nokia.com/forums/viewthread/11533/.

    At present I've used the "ActiveQt Server" template for creating a COM object, which generated some *.tlb file. So, its easy now from Qt perspective.

    Now I want something more;

    While creating the COM project by using the respective template as mentioned above, I got error by not including below respective methods,

    @
    ULONG STDMETHODCALLTYPE AddRef( void);
    ULONG STDMETHODCALLTYPE Release( void);
    STDMETHOD(QueryInterface)(
    /* [in] / REFIID riid,
    /
    [iid_is][out] */ __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject);
    @

    I don't understand what this mean to be from QT perspective, this came form "unknwn.h" , which seems to be Microsoft SDK file.Below shows similar error of not including AddRef() ,

    @
    classA.cpp(103): error C2259: 'ClassA' : cannot instantiate abstract class
    due to following members:
    1> 'ULONG IUnknown::AddRef(void)' : is abstract
    1> C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\unknwn.h(120) : see declaration of 'IUnknown::AddRef'
    @

    My "classA" is derving some 3rd party abstract class, in order to implement it in my class , "classA". So, I don't understand why to include those methods or is that necessary to include it.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      If you need these methods, depends, how you implement you class. As you don't show your code, itÄs hard to say.
      In COM in general, all interfaces are derived from IUnknown, which defines these methods.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • F Offline
        F Offline
        feedmeqt
        wrote on last edited by
        #3

        Hi,

        Well, as you said "how you implement your class" , this is excatly what I needed. As I'm new to C++ concepts & Qt, I'm not getting understanding it properly.

        I've captured that here "11533":http://developer.qt.nokia.com/forums/viewthread/11533/

        "scanner" class is the 3rd party dll and it will be calling my COM dll.

        One basic doubt is like , is that the 3rd party class which I'm deriving will be qurering my COM dll for the fundtion signature, is that for this case its useful.

        Waiting for reply,

        Thanks,

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved