Remove some hardcode strings
authorMagnus Olsen <magnus@greatlord.com>
Sun, 1 May 2005 17:32:09 +0000 (17:32 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 1 May 2005 17:32:09 +0000 (17:32 +0000)
to En.rc

svn path=/trunk/; revision=14917

reactos/subsys/ntvdm/En.rc [new file with mode: 0644]
reactos/subsys/ntvdm/ntvdm.c
reactos/subsys/ntvdm/ntvdm.rc
reactos/subsys/ntvdm/resource.h [new file with mode: 0644]

diff --git a/reactos/subsys/ntvdm/En.rc b/reactos/subsys/ntvdm/En.rc
new file mode 100644 (file)
index 0000000..14a9116
--- /dev/null
@@ -0,0 +1,13 @@
+#include "resource.h"\r
+/*\r
+ * Moved all hardcoded strings to En.rc.\r
+ * By Magnus Olsen  2005\r
+ */\r
+\r
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT\r
+STRINGTABLE DISCARDABLE\r
+{\r
+\r
+STRING_WelcomeMsg,      "ReactOS Virtual DOS Machine support.\n"\r
+STRING_PromptMsg,       "Type r<cr> to run, s<cr> to shutdown or q<cr> to quit now."\r
+}\r
index 11f7845..44f7a1a 100644 (file)
@@ -15,6 +15,7 @@
 #include <windows.h>
 #include <stdio.h>
 #include <wchar.h>
+#include "resource.h"
 
 #define NDEBUG
 #include <debug.h>
@@ -205,6 +206,7 @@ CreateVDM(PVDM_CONTROL_BLOCK vdm)
     SYSTEM_INFO inf;
     MEMORYSTATUS stat;
 
+
     GlobalMemoryStatus(&stat);
     if (stat.dwLength != sizeof(MEMORYSTATUS)) {
         printf("WARNING: GlobalMemoryStatus() returned unknown structure version, size %ld, expected %d.\n", stat.dwLength, sizeof(stat));
@@ -223,6 +225,7 @@ CreateVDM(PVDM_CONTROL_BLOCK vdm)
             //SetLastError();
             return FALSE;
         }
+        
     }
  
     GetSystemInfo(&inf);
@@ -273,10 +276,13 @@ WinMain(HINSTANCE hInstance,  HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho
     ULONG i;
     BOOL vdmStarted = FALSE;
 
-    WCHAR WelcomeMsg[] = L"ReactOS Virtual DOS Machine support.\n";
-    WCHAR PromptMsg[] = L"Type r<cr> to run, s<cr> to shutdown or q<cr> to quit now.";
+    TCHAR WelcomeMsg[RC_STRING_MAX_SIZE];
+    TCHAR PromptMsg[RC_STRING_MAX_SIZE];
     CHAR InputBuffer[255];
-    
+
+       LoadString( GetModuleHandle(NULL), STRING_WelcomeMsg, WelcomeMsg,sizeof(WelcomeMsg));
+    LoadString( GetModuleHandle(NULL), STRING_PromptMsg, PromptMsg ,sizeof(PromptMsg));
+
     AllocConsole();
     SetConsoleTitleW(L"ntvdm");
 
index 4363aab..afba36c 100644 (file)
@@ -1,6 +1,10 @@
 /* $Id$ */
 
+#include <windows.h>
 #define REACTOS_STR_FILE_DESCRIPTION   "ReactOS Virtual DOS Machine\0"
 #define REACTOS_STR_INTERNAL_NAME      "ntvdm\0"
 #define REACTOS_STR_ORIGINAL_FILENAME  "ntvdm.exe\0"
 #include <reactos/version.rc>
+
+#include "En.rc"
+
diff --git a/reactos/subsys/ntvdm/resource.h b/reactos/subsys/ntvdm/resource.h
new file mode 100644 (file)
index 0000000..0600fe4
--- /dev/null
@@ -0,0 +1,6 @@
+#define RC_STRING_MAX_SIZE                 2048\r
+#define STRING_WelcomeMsg                   100\r
+#define STRING_PromptMsg                    101 \r
+\r
+\r
+/* EOF */\r