Modified: trunk/rosapps/packmgr/cmd-line/rosget.xml
Modified: trunk/rosapps/packmgr/directory.xml
Modified: trunk/rosapps/packmgr/gui/main.c
Modified: trunk/rosapps/packmgr/gui/packmgr.xml
Modified: trunk/rosapps/packmgr/lib/es.rc
Modified: trunk/rosapps/packmgr/lib/main.cpp
Modified: trunk/rosapps/packmgr/lib/package.cpp
Modified: trunk/rosapps/packmgr/lib/package.h
Modified: trunk/rosapps/packmgr/lib/package.hpp
Added: trunk/rosapps/packmgr/lib/package.xml
Deleted: trunk/rosapps/packmgr/lib/packlib.xml
--- trunk/rosapps/packmgr/cmd-line/rosget.xml 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/cmd-line/rosget.xml 2005-11-25 21:25:42 UTC (rev 19570)
@@ -1,12 +1,12 @@
<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>
--- trunk/rosapps/packmgr/directory.xml 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/directory.xml 2005-11-25 21:25:42 UTC (rev 19570)
@@ -5,5 +5,5 @@
<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
--- trunk/rosapps/packmgr/gui/main.c 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/gui/main.c 2005-11-25 21:25:42 UTC (rev 19570)
@@ -40,6 +40,7 @@
HWND hwnd;
MSG msg;
WNDCLASSEX wc = {0};
+ WCHAR errbuf[2000];
// Window creation
wc.cbSize = sizeof(WNDCLASSEX);
@@ -78,7 +79,7 @@
if(error)
{
- MessageBox(0,PML_TransError(error),0,0);
+ MessageBox(0,PML_TransError(error, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0);
return 0;
}
@@ -154,12 +155,13 @@
{
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));
@@ -388,6 +390,8 @@
// 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);
@@ -406,7 +410,7 @@
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;
--- trunk/rosapps/packmgr/gui/packmgr.xml 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/gui/packmgr.xml 2005-11-25 21:25:42 UTC (rev 19570)
@@ -1,5 +1,5 @@
<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" />
@@ -9,7 +9,7 @@
<library>kernel32</library>
<library>user32</library>
<library>comctl32</library>
- <library>packlib</library>
+ <library>package</library>
<file>main.c</file>
<file>packmgr.rc</file>
--- trunk/rosapps/packmgr/lib/es.rc 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/es.rc 2005-11-25 21:25:42 UTC (rev 19570)
@@ -21,4 +21,4 @@
123 RCDATA "options.xml"
-/* EOF */
\ No newline at end of file
+/* EOF */
--- trunk/rosapps/packmgr/lib/main.cpp 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/main.cpp 2005-11-25 21:25:42 UTC (rev 19570)
@@ -119,8 +119,10 @@
//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;
@@ -136,13 +138,11 @@
}
// 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;
}
--- trunk/rosapps/packmgr/lib/package.cpp 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/package.cpp 2005-11-25 21:25:42 UTC (rev 19570)
@@ -167,8 +167,8 @@
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++)
{
@@ -187,7 +187,7 @@
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)
{
--- trunk/rosapps/packmgr/lib/package.h 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/package.h 2005-11-25 21:25:42 UTC (rev 19570)
@@ -28,7 +28,7 @@
/* 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);
--- trunk/rosapps/packmgr/lib/package.hpp 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/package.hpp 2005-11-25 21:25:42 UTC (rev 19570)
@@ -72,7 +72,7 @@
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);
--- trunk/rosapps/packmgr/lib/package.xml 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/package.xml 2005-11-25 21:25:42 UTC (rev 19570)
@@ -0,0 +1,25 @@
+<module name="package" type="win32dll" installbase="system32" installname="package.dll">
+ <importlibrary definition="package.def" />
+ <include base="package">.</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>
--- trunk/rosapps/packmgr/lib/packlib.xml 2005-11-25 19:38:07 UTC (rev 19569)
+++ trunk/rosapps/packmgr/lib/packlib.xml 2005-11-25 21:25:42 UTC (rev 19570)
@@ -1,25 +0,0 @@
-<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>