projects
/
platform
/
core
/
uifw
/
dali-demo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated demos to use DALi clang-format
[platform/core/uifw/dali-demo.git]
/
shared
/
execute-process-win.cpp
diff --git
a/shared/execute-process-win.cpp
b/shared/execute-process-win.cpp
index
8445221
..
64a4a0a
100644
(file)
--- a/
shared/execute-process-win.cpp
+++ b/
shared/execute-process-win.cpp
@@
-15,38
+15,47
@@
*
*/
*
*/
-
// FILE HEADER
+// FILE HEADER
#include "execute-process.h"
#include "execute-process.h"
- // EXTERNAL INCLUDES
-#include <windows.h>
+// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/common/dali-common.h>
+#include <windows.h>
namespace
{
namespace
{
-const std::string PATH_SEPARATOR(
"\\"
);
+const std::string PATH_SEPARATOR(
"\\"
);
}
}
-void ExecuteProcess(
const std::string& processName, Dali::Application& application
)
+void ExecuteProcess(
const std::string& processName, Dali::Application& application
)
{
{
- char currentPath[MAX_PATH];
- DWORD numberOfCharacters = GetCurrentDirectory( MAX_PATH, currentPath );
+ std::string processPathName;
- if( 0u == numberOfCharacters )
+ const bool isRelativePath = '.' == DEMO_EXAMPLE_BIN[0];
+ if(isRelativePath)
{
{
-
DALI_ASSERT_ALWAYS( !"Failed to retrieve the current working directory" )
;
- }
+
char currentPath[MAX_PATH]
;
+ DWORD numberOfCharacters = GetCurrentDirectory(MAX_PATH, currentPath);
- currentPath[numberOfCharacters] = '\0';
+ if(0u == numberOfCharacters)
+ {
+ DALI_ASSERT_ALWAYS(!"Failed to retrieve the current working directory");
+ }
- const std::string processPathName = std::string( currentPath ) + PATH_SEPARATOR + DEMO_EXAMPLE_BIN + PATH_SEPARATOR + processName + ".exe";
+ currentPath[numberOfCharacters] = '\0';
+ processPathName = std::string(currentPath) + PATH_SEPARATOR + DEMO_EXAMPLE_BIN + PATH_SEPARATOR + processName + ".exe";
+ }
+ else
+ {
+ processPathName = DEMO_EXAMPLE_BIN + PATH_SEPARATOR + processName + ".exe";
+ }
- STARTUPINFO
info = { sizeof( info )
};
+ STARTUPINFO
info = {sizeof(info)
};
PROCESS_INFORMATION processInfo;
PROCESS_INFORMATION processInfo;
- if(
CreateProcess( processPathName.c_str(), nullptr, nullptr, nullptr, TRUE, 0, nullptr, nullptr, &info, &processInfo )
)
+ if(
CreateProcess(processPathName.c_str(), nullptr, nullptr, nullptr, TRUE, 0, nullptr, nullptr, &info, &processInfo)
)
{
{
- WaitForSingleObject(
processInfo.hProcess, INFINITE
);
- CloseHandle(
processInfo.hProcess
);
- CloseHandle(
processInfo.hThread
);
+ WaitForSingleObject(
processInfo.hProcess, INFINITE
);
+ CloseHandle(
processInfo.hProcess
);
+ CloseHandle(
processInfo.hThread
);
}
}
}
}