<module name="rosget" type="win32cui" installbase="system32" installname="rosget.exe">
- <include base="packlib">.</include>
+ <include base="package">.</include>
<define name="__USE_W32API" />
<define name="UNICODE" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
<library>kernel32</library>
- <library>packlib</library>
+ <library>package</library>
<file>main.c</file>
<file>ros-get.rc</file>
</module>
<xi:include href="gui/packmgr.xml" />
</directory>
<directory name="lib">
- <xi:include href="lib/packlib.xml" />
+ <xi:include href="lib/package.xml" />
</directory>
\ No newline at end of file
HWND hwnd;
MSG msg;
WNDCLASSEX wc = {0};
+ WCHAR errbuf[2000];
// Window creation
wc.cbSize = sizeof(WNDCLASSEX);
if(error)
{
- MessageBox(0,PML_TransError(error),0,0);
+ MessageBox(0,PML_TransError(error, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0);
return 0;
}
{
HINSTANCE hinst = GetModuleHandle(NULL);
+ WCHAR errbuf[2000];
// Create the controls
hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
0, 0, 0, 0, hwnd, NULL, hinst, NULL);
- hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD), WS_CHILD|WS_VISIBLE|ES_MULTILINE,
+ hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE,
0, 0, 100, 100, hwnd, NULL, hinst, NULL);
hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP));
// Warning: This function is called from another thread
int SetStatus (int status1, int status2, WCHAR* text)
{
+ WCHAR errbuf[2000];
+
// Set the Rage to 1000
SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000);
SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000);
if(status1==1000)
{
EndDialog(hStatus, TRUE);
- MessageBox(0,PML_TransError(status2),0,0);
+ MessageBox(0,PML_TransError(status2, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0);
}
return 0;
<module name="packmgr" type="win32gui" installbase="system32" installname="packmgr.exe">
- <include base="packlib">.</include>
+ <include base="package">.</include>
<include base="packmgr">.</include>
<define name="__USE_W32API" />
<define name="UNICODE" />
<library>kernel32</library>
<library>user32</library>
<library>comctl32</library>
- <library>packlib</library>
+ <library>package</library>
<file>main.c</file>
<file>packmgr.rc</file>
\r
123 RCDATA "options.xml"\r
\r
-/* EOF */
\ No newline at end of file
+/* EOF */\r
//ask
WCHAR buffer [2000];
- wsprintf(buffer, PML_TransError(ERR_READY), tree->todo.size());
+ WCHAR errbuf [2000];
+
+ wsprintf(buffer, PML_TransError(ERR_READY, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)), tree->todo.size());
if(!Ask(buffer))
return ERR_GENERIC;
}
// Translates Errorcode into human language
-extern "C" WCHAR* PML_TransError (int code)
+extern "C" WCHAR* PML_TransError (int code, WCHAR *string, INT maxchar)
{
- // I know we, got a memory leak here
- static WCHAR string [256];
- if(!LoadString(GetModuleHandle(L"package"), code, string, 256))
- return PML_TransError(ERR_GENERIC);
+ if(!LoadString(GetModuleHandle(L"package"), code, string, maxchar))
+ return PML_TransError(ERR_GENERIC, string, maxchar);
return string;
}
if(pack->depencies.size() && action)
{
UINT count = pack->depencies.size();
- WCHAR buffer[2000], buffer2[200];
- wcscpy(buffer, PML_TransError(ERR_DEP1));
+ WCHAR buffer[2000], buffer2[200], errbuf[2000];
+ PML_TransError(ERR_DEP1, (WCHAR*)buffer, sizeof(buffer)/sizeof(WCHAR));
for (i=0; i<pack->depencies.size(); i++)
{
wsprintf(buffer, L"%s - %s\n", buffer, buffer2);//
}
- wcscat(buffer, PML_TransError(ERR_DEP2));
+ wcscat(buffer, PML_TransError(ERR_DEP2, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)));
if(count)
{
/* Prototypes */
void PML_Abort (void);
-WCHAR* PML_TransError (int code);
+WCHAR* PML_TransError (int code, WCHAR* string, INT maxchar);
int PML_LoadTree (pTree*, char* url, PML_AddItem);
int PML_FindItem (pTree tree, const char* what);
extern "C"
{
void PML_Abort (void);
- WCHAR* PML_TransError (int code);
+ WCHAR* PML_TransError (int code, WCHAR* string, INT maxchar);
int PML_LoadTree (pTree*, char* url, PML_AddItem);
int PML_FindItem (TREE* tree, const char* what);
-<module name="packlib" type="win32dll" installbase="system32" installname="package.dll">
- <importlibrary definition="package.def" />
- <include base="packlib">.</include>
-
- <define name="UNICODE" />
- <define name="__USE_W32API" />
- <define name="_WIN32_IE">0x0501</define>
- <define name="_WIN32_WINNT">0x0501</define>
-
- <library>kernel32</library>
- <library>gdi32</library>
- <library>user32</library>
- <library>expat</library>
- <library>urlmon</library>
-
- <file>download.cpp</file>
- <file>functions.cpp</file>
- <file>log.cpp</file>
- <file>main.cpp</file>
- <file>options.cpp</file>
- <file>package.cpp</file>
- <file>script.cpp</file>
- <file>tree.cpp</file>
- <file>package.rc</file>
-</module>
+<module name="package" type="win32dll" installbase="system32" installname="package.dll">\r
+ <importlibrary definition="package.def" />\r
+ <include base="package">.</include>\r
+\r
+ <define name="UNICODE" />\r
+ <define name="__USE_W32API" />\r
+ <define name="_WIN32_IE">0x0501</define>\r
+ <define name="_WIN32_WINNT">0x0501</define>\r
+\r
+ <library>kernel32</library>\r
+ <library>gdi32</library>\r
+ <library>user32</library>\r
+ <library>expat</library>\r
+ <library>urlmon</library>\r
+\r
+ <file>download.cpp</file>\r
+ <file>functions.cpp</file>\r
+ <file>log.cpp</file>\r
+ <file>main.cpp</file>\r
+ <file>options.cpp</file>\r
+ <file>package.cpp</file>\r
+ <file>script.cpp</file>\r
+ <file>tree.cpp</file>\r
+ <file>package.rc</file>\r
+</module>\r