Jan 4, 2004 #1 scottmanjoe Technical User Mar 28, 2003 15 IN Hello, How to ensure that there is only one instance of the application that is running. Thanks, Scott
Hello, How to ensure that there is only one instance of the application that is running. Thanks, Scott
Jan 5, 2004 #2 CodingNovice Programmer Dec 30, 2003 108 GB Look into CreateMutex() for windows systems. Upvote 0 Downvote
Jan 5, 2004 1 #3 Cagliostro Programmer Sep 13, 2000 4,226 GB //declaring section as read/write/shared #pragma comment(linker, "/section:SomeSectionName,rws" #pragma data_seg("SomeSectionName"//begin of section //the section there will be shared //between different instances of programs static bool isRunningAlready = false; #pragma data_seg() //end iof section int main() { if(isRunningAlready)return 0; isRunningAlready = true; ...... return 0; } Ion Filipski Upvote 0 Downvote
//declaring section as read/write/shared #pragma comment(linker, "/section:SomeSectionName,rws" #pragma data_seg("SomeSectionName"//begin of section //the section there will be shared //between different instances of programs static bool isRunningAlready = false; #pragma data_seg() //end iof section int main() { if(isRunningAlready)return 0; isRunningAlready = true; ...... return 0; } Ion Filipski