/[projet1]/public/pc/tools/osdk/main/common/sources/common.cpp
Defence Force logotype

Diff of /public/pc/tools/osdk/main/common/sources/common.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1012 by dbug, Sun Nov 24 13:29:03 2013 UTC revision 1013 by dbug, Thu Dec 12 19:35:12 2013 UTC
# Line 41  void SetApplicationParameters(const char Line 41  void SetApplicationParameters(const char
41    
42    
43    
44  void ShowError(const char *message)  void ShowError(const char *pFormatString,...)
45  {  {
46    std::string cErrorMessage;    std::string cErrorMessage;
47    
48    if (message)    if (pFormatString)
49    {    {
50      // Message will be something like: "MyApplication.exe: Something goes wrong, sorry !"      // Message will be something like: "MyApplication.exe: Something goes wrong, sorry !"
51      cErrorMessage=g_cApplicationName+": "+ message;  
52        va_list va;
53        char    temp[4096];
54    
55        va_start(va,pFormatString);
56        int nChar=vsprintf(temp,pFormatString,va);
57        va_end(va);
58        if ((unsigned int)nChar>=sizeof(temp))
59        {
60          temp[sizeof(temp)-1]=0;
61        }
62    
63        cErrorMessage=g_cApplicationName+": "+ temp;
64    }    }
65    else    else
66    {    {
67      cErrorMessage=g_cUsageMessage;      cErrorMessage=g_cUsageMessage;
68      StringReplace(cErrorMessage,"{ApplicationName}"             ,g_cApplicationName);      StringReplace(cErrorMessage,"{ApplicationName}"     ,g_cApplicationName);
69      StringReplace(cErrorMessage,"{ApplicationVersion}"  ,g_cVersionString);      StringReplace(cErrorMessage,"{ApplicationVersion}"  ,g_cVersionString);
70    }    }
71    

Legend:
Removed from v.1012  
changed lines
  Added in v.1013

  ViewVC Help
Powered by ViewVC 1.1.26