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. how to implement in-process axserver as singleton
Qt 6.11 is out! See what's new in the release blog

how to implement in-process axserver as singleton

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 253 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.
  • Y Offline
    Y Offline
    youcl
    wrote on last edited by youcl
    #1

    I am building an activex control dll running in IE with qt axserver. Is there a way to implement the exported class as singleton, so when IE page got refresh, it won't create new instance?

    I find enum QAxFactory::ServerType has QAxFactory::SingleInstance, but it seems this is used with bool QAxFactory::startServer(QAxFactory::ServerType type = MultipleInstances) which is only effective with out-of-process activex control.

    Is there something equivalent for in-process activex control?

    UPDATE I found a way to achieve it: Using subclass of QAxFactory and reimplement createObject(const QString &key) to create my exported class with singleton pattern. But I have to set static pointer to the single instance to 0 in deconstruction, or idc.exe will fail with read access violation. Still don't know the reason, but it kind works.

    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