Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to implement in-process axserver as singleton
youcl last edited by youcl
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?
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
createObject(const QString &key)to create my exported class with singleton pattern. But I have to set static pointer to the single instance to
0in deconstruction, or
idc.exewill fail with read access violation. Still don't know the reason, but it kind works.