Question / Help why need make sure only one instance of the application can be open at a time?

kavin

New Member
Hi
//------------------------------------------------------------
//make sure only one instance of the application can be open at a time

hOBSMutex = CreateMutex(NULL, TRUE, TEXT("OBSMutex"));
if(!bDisableMutex && GetLastError() == ERROR_ALREADY_EXISTS)
{
hwndMain = FindWindow(OBS_WINDOW_CLASS, NULL);
if(hwndMain)
SetForegroundWindow(hwndMain);

CloseHandle(hOBSMutex);
return 0;
}

//------------------------------------------------------------

why just one instance of the application can be open at one time ?
can I delete this to open Multiple instance of the application at one time .
-----------------
why do this ,bcs i want to capture Multiple streams to stream service.
can i do this?if not,pls tell me why.
thx very much.
 

paibox

heros in an halfshel
Because most people would not benefit from having more than one instance of OBS running.

You do NOT need to remove that code, there is functionality in place to open more than one instance of OBS, just make a .bat file and put "obs -multi" in it. (This has nothing to do with development, so I'm moving this post to Questions and Help.)
 
Top