Results 1 to 4 of 4

Thread: How to create single instance application using c++

  1. #1
    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?

  2. #2
    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.

  3. #3
    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.

  4. #4
    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,711,891.53496 seconds with 16 queries