Hi Friends,
I am using Qt 4.2 in Windows, I am creating one application in Qt, I want to restrict my user to run more than one exe of my application,
Is there any method to do this?
Please Help me.
Thanks,
Rajesh.S
Hi Friends,
I am using Qt 4.2 in Windows, I am creating one application in Qt, I want to restrict my user to run more than one exe of my application,
Is there any method to do this?
Please Help me.
Thanks,
Rajesh.S
I you own a Qt commercial license you can have a look at Qt solutions : there's a QtSingleApplication.
However if you want an open-source solution you may be interested in the little class I've crafted : QSingleApplication it uses a temp file and local networking through TCP/IP to check whether an instance is already running and is able to communicate with the existing instance if any
Current Qt projects : QCodeEdit, RotiDeCode
rajeshs (5th July 2007)
J-P Nurmi
With the ActiveQt module you could also use QAxFactory::registerActiveObject()
Well I've not packaged anything so you'll have to rely on SVN... Just do a checkout of : https://edyuk.svn.sf.net/svnroot/edy...dparty/qcumber All the code resides there (but there are also unrelated classes...) in QSingleApplication, QInterProcessChannel, QManagedSocket and QManagedRequest. The only class you need to know about, for most usess, is QSingleApplication. Just create one instead of a QApplication (or subclass it instead of subclassing directly QApplication) then check isInstanceAllowed() before calling exec() and you're done...
Current Qt projects : QCodeEdit, RotiDeCode
Bookmarks