Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 26-05-2009
Member
 
Join Date: Apr 2009
Posts: 69
How to create single instance application using c++

How to create an single instance of application using C++ programming, I don't know how to create an application using C++, but it would be great help if anybody would give any suggestion regarding it, do i need to create ActiveX control?
Reply With Quote
  #2  
Old 26-05-2009
Member
 
Join Date: Jan 2009
Posts: 143
Re: How to create single instance application using c++

The project source contains a WinMain() function. WinMain() is the entry point for all Windows GUI applications. To solve the single instance application problem an approach would be to passes the new command line to the existing instance of the application. To write an single instance application you need to have C++Builder 4, or else you could develop an project Source in C++Builder 1 and 3.
Reply With Quote
  #3  
Old 26-05-2009
Member
 
Join Date: Jan 2009
Posts: 140
Re: How to create single instance application using c++

I will give some hint regarding creating an application, when your c++ application loads, start your C# application by using WinExec or ShellExecute function.Your C# have to control BY ITSELF to prevent to run twice, using the single-instance trick (look at my first post).If you don't do this way, your C# could be ran twice by calling it outside the C++ aplication.
Reply With Quote
  #4  
Old 26-05-2009
Member
 
Join Date: Jan 2009
Posts: 143
Re: How to create single instance application using c++

Making single-instance an application means enabling the application to recognize, at startup, The most known solutions are:
  • Using a CMutex (a synchronization object global to the system).
  • Using shared data sections.

The first parameter will be bool indicating that to activate the older instances of the class if need to call the second instance. The second parameter is an optional string, which specifies the name of the Mutex and window class, therefore either you don't need to specify the parameter, or pass NULL to it.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to create single instance application using c++"
Thread Thread Starter Forum Replies Last Post
How to create an instance of Bean in java? Madaleno Software Development 4 03-02-2010 09:33 PM
Single instance of singleton for all JVMs KANAN14 Software Development 3 30-10-2009 07:10 PM
Running Multiple Instance of single application on Mac OS MaCiNToSHeR Operating Systems 6 26-08-2009 11:05 PM
create multiple OS bootable Image in single DVD Preetish Operating Systems 2 02-03-2009 11:44 AM
PC with a Single Application Chingum Technology & Internet 4 02-01-2009 12:45 PM


All times are GMT +5.5. The time now is 08:36 PM.