diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-07 12:10:26 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-07 12:10:26 +0000 |
commit | 1d18d087d47d7a54f68950f983029642a54d6f43 (patch) | |
tree | f13ea4f54b2c576ce802388022b5c8545483bc05 /plugins/CmdLine/src/services.cpp | |
parent | 1dd4c9316543ff292ce250f7f08b25385fc8e37a (diff) |
- common.props divided into app.props & plugin.props;
- MimCmd & CmdLine converted to Unicode;
git-svn-id: http://svn.miranda-ng.org/main/trunk@14048 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CmdLine/src/services.cpp')
-rw-r--r-- | plugins/CmdLine/src/services.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/plugins/CmdLine/src/services.cpp b/plugins/CmdLine/src/services.cpp index 6a82974be5..ae146cd8ef 100644 --- a/plugins/CmdLine/src/services.cpp +++ b/plugins/CmdLine/src/services.cpp @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "commonheaders.h"
+#include "stdafx.h"
int bWaitForUnload = 0;
@@ -37,12 +37,12 @@ extern "C" __declspec(dllexport) void ProcessConsoleCommand(PCommand command, TA HandleCommand(command, arguments, count, reply);
}
-void __cdecl ServerWorkerThread(void *data)
+void __cdecl ServerWorkerThread(void*)
{
int done = FALSE;
const HANDLE events[] = {heServerExec, heServerClose};
const int cEvents = sizeof(events) / sizeof(events[0]);
-
+
while (!done)
{
switch (WaitForMultipleObjects(cEvents, events, FALSE, INFINITE))
@@ -51,14 +51,14 @@ void __cdecl ServerWorkerThread(void *data) {
ProcessConsoleCommand(&sdCmdLine->command, sdCmdLine->arguments, sdCmdLine->cArguments, &sdCmdLine->reply);
SetEvent(heServerDone); //notify the client we've finished
-
+
break;
}
-
+
case WAIT_OBJECT_0 + 1: //server is closing
{
done = TRUE; //stop the thread
-
+
break;
}
}
@@ -76,23 +76,19 @@ int StartServer() if (server)
{
char path[MIMFOLDER_SIZE];
- GetModuleFileName(GetModuleHandle(NULL), path, sizeof(path));
+ GetModuleFileNameA(GetModuleHandle(NULL), path, sizeof(path));
char *p = strrchr(path, '\\');
if (p) { *p = 0; }
- STRNCPY(sdCmdLine->mimFolder, path, MIMFOLDER_SIZE);
+ strncpy_s(sdCmdLine->mimFolder, path, _TRUNCATE);
sdCmdLine->instances++;
-
+
failure = 0;
}
- else{
- PUShowMessage(Translate("Could not create CommandLine listening server!"), SM_WARNING);
- }
- }
- else{
- MessageBox(NULL, Translate("You can only run one instance of CmdLine plugin."), Translate("Error"), MB_ICONERROR | MB_OK);
+ else PUShowMessageT(TranslateT("Could not create CommandLine listening server!"), SM_WARNING);
}
+ else MessageBox(NULL, TranslateT("You can only run one instance of CmdLine plugin."), TranslateT("Error"), MB_ICONERROR | MB_OK);
}
-
+
return failure;
}
|