mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
Remove all hardcode string to En.rc
so it can be translate svn path=/trunk/; revision=15243
This commit is contained in:
parent
d344ac5409
commit
08142b98ea
3 changed files with 35 additions and 4 deletions
12
reactos/subsys/system/rundll32/En.rc
Normal file
12
reactos/subsys/system/rundll32/En.rc
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include "resource.h"
|
||||||
|
/*
|
||||||
|
* Moved all hardcoded strings to En.rc.
|
||||||
|
* By Magnus Olsen 2005 magnus@itkonsult-olsen.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||||
|
STRINGTABLE DISCARDABLE
|
||||||
|
{
|
||||||
|
IDS_DllNotLoaded, "LoadLibrary failed to load \'%s\'"
|
||||||
|
IDS_MissingEntry, "Missing entry point:%s\nIn %s"
|
||||||
|
}
|
7
reactos/subsys/system/rundll32/resource.h
Normal file
7
reactos/subsys/system/rundll32/resource.h
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
#define RC_STRING_MAX_SIZE 200
|
||||||
|
#define IDS_DllNotLoaded 100
|
||||||
|
#define IDS_MissingEntry 101
|
||||||
|
|
||||||
|
/* EOF */
|
|
@ -28,6 +28,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
typedef int (WINAPI *DllWinMainW)(
|
typedef int (WINAPI *DllWinMainW)(
|
||||||
HWND hWnd,
|
HWND hWnd,
|
||||||
|
@ -42,13 +43,17 @@ typedef int (WINAPI *DllWinMainA)(
|
||||||
int nCmdShow
|
int nCmdShow
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
LPCTSTR DllNotLoaded = _T("LoadLibrary failed to load \"%s\"");
|
LPCTSTR DllNotLoaded = _T("LoadLibrary failed to load \"%s\"");
|
||||||
LPCTSTR MissingEntry = _T("Missing entry point:%s\nIn %s");
|
LPCTSTR MissingEntry = _T("Missing entry point:%s\nIn %s");
|
||||||
|
*/
|
||||||
LPCTSTR rundll32_wtitle = _T("rundll32");
|
LPCTSTR rundll32_wtitle = _T("rundll32");
|
||||||
LPCTSTR rundll32_wclass = _T("rundll32_window");
|
LPCTSTR rundll32_wclass = _T("rundll32_window");
|
||||||
|
|
||||||
TCHAR ModuleFileName[MAX_PATH+1];
|
TCHAR ModuleFileName[MAX_PATH+1];
|
||||||
LPTSTR ModuleTitle;
|
LPTSTR ModuleTitle;
|
||||||
|
|
||||||
|
|
||||||
// CommandLineToArgv converts a command-line string to argc and
|
// CommandLineToArgv converts a command-line string to argc and
|
||||||
// argv similar to the ones in the standard main function.
|
// argv similar to the ones in the standard main function.
|
||||||
// This is a specialized version coded specifically for rundll32
|
// This is a specialized version coded specifically for rundll32
|
||||||
|
@ -327,6 +332,8 @@ int WINAPI WinMain(
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int argc;
|
int argc;
|
||||||
|
TCHAR szMsg[RC_STRING_MAX_SIZE];
|
||||||
|
|
||||||
LPTSTR *argv;
|
LPTSTR *argv;
|
||||||
LPTSTR lptCmdLine,lptDllName,lptFuncName,lptMsgBuffer;
|
LPTSTR lptCmdLine,lptDllName,lptFuncName,lptMsgBuffer;
|
||||||
LPSTR lpFuncName,lpaCmdLine;
|
LPSTR lpFuncName,lpaCmdLine;
|
||||||
|
@ -440,8 +447,10 @@ int WINAPI WinMain(
|
||||||
else {
|
else {
|
||||||
// The specified dll function was not found; display an error message
|
// The specified dll function was not found; display an error message
|
||||||
GetModuleTitle();
|
GetModuleTitle();
|
||||||
lptMsgBuffer = (LPTSTR)malloc((_tcslen(MissingEntry) - 4 + _tcslen(lptFuncName) + _tcslen(lptDllName) + 1) * sizeof(TCHAR));
|
LoadString( GetModuleHandle(NULL), IDS_MissingEntry, (LPTSTR) szMsg,RC_STRING_MAX_SIZE);
|
||||||
_stprintf(lptMsgBuffer,MissingEntry,lptFuncName,lptDllName);
|
|
||||||
|
lptMsgBuffer = (LPTSTR)malloc((_tcslen(szMsg) - 4 + _tcslen(lptFuncName) + _tcslen(lptDllName) + 1) * sizeof(TCHAR));
|
||||||
|
_stprintf(lptMsgBuffer,szMsg,lptFuncName,lptDllName);
|
||||||
MessageBox(0,lptMsgBuffer,ModuleTitle,MB_ICONERROR);
|
MessageBox(0,lptMsgBuffer,ModuleTitle,MB_ICONERROR);
|
||||||
free(lptMsgBuffer);
|
free(lptMsgBuffer);
|
||||||
}
|
}
|
||||||
|
@ -455,8 +464,11 @@ int WINAPI WinMain(
|
||||||
else {
|
else {
|
||||||
// The dll could not be loaded; display an error message
|
// The dll could not be loaded; display an error message
|
||||||
GetModuleTitle();
|
GetModuleTitle();
|
||||||
lptMsgBuffer = (LPTSTR)malloc((_tcslen(DllNotLoaded) - 2 + _tcslen(lptDllName) + 1) * sizeof(TCHAR));
|
LoadString( GetModuleHandle(NULL), IDS_DllNotLoaded, (LPTSTR) szMsg,RC_STRING_MAX_SIZE);
|
||||||
_stprintf(lptMsgBuffer,DllNotLoaded,lptDllName);
|
|
||||||
|
lptMsgBuffer = (LPTSTR)malloc((_tcslen(szMsg) - 2 + _tcslen(lptDllName) + 1) * sizeof(TCHAR));
|
||||||
|
_stprintf(lptMsgBuffer,szMsg,lptDllName);
|
||||||
|
|
||||||
MessageBox(0,lptMsgBuffer,ModuleTitle,MB_ICONERROR);
|
MessageBox(0,lptMsgBuffer,ModuleTitle,MB_ICONERROR);
|
||||||
free(lptMsgBuffer);
|
free(lptMsgBuffer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue