Jan 4, 2004 #1 scottmanjoe Technical User Joined Mar 28, 2003 Messages 15 Location 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 Joined Dec 30, 2003 Messages 108 Location GB Look into CreateMutex() for windows systems. Upvote 0 Downvote
Jan 5, 2004 1 #3 Cagliostro Programmer Joined Sep 13, 2000 Messages 4,226 Location 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