Patch level :

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :


git-svn-id: svn://10.65.10.50/trunk@15930 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-12-20 10:44:31 +00:00
parent 1aafb67bc7
commit edd1a66d5e
2 changed files with 88 additions and 86 deletions

View File

@ -232,16 +232,18 @@ bool CampoSetup::CreateAutostartMode(const LurchMode iSrvAutostartMode, const wx
//stringa path della cartella Servers in base alle scelte dell'utente //stringa path della cartella Servers in base alle scelte dell'utente
const wxString strSrvPath = strExe.GetPath(); const wxString strSrvPath = strExe.GetPath();
//Eliminatore di precedenti servers installati come servizi //1) Eliminatore di precedenti servers installati come servizi
//cerca se non esiste per caso gia' da una precedente installazione.. //cerca se non esiste per caso gia' da una precedente installazione..
//..non serve piu' a un cazzo ma si e' tenuto come prova in debug di lettura del registry! //..non serve piu' a un cazzo ma si e' tenuto come prova in debug di lettura del registry!
wxString strValue = ReadLocalMachineRegistryKey("SYSTEM\\CurrentControlSet\\Services\\Lurch\\Parameters\\Application"); wxString strValue = ReadLocalMachineRegistryKey("SYSTEM\\CurrentControlSet\\Services\\Lurch\\Parameters\\Application");
//elimina un eventuale servizio precedente (senno' col cavolo che lo riesce a modificare!) //elimina un eventuale servizio precedente (senno' col cavolo che lo riesce a modificare!)
//utilizza il programma instsrv.exe dentro la cartella servers installata //utilizza il programma instsrv.exe dentro la cartella servers installata
wxString strRemove = strSrvPath + "\\instsrv Lurch REMOVE"; wxString strRemove = strSrvPath + "\\instsrv Lurch REMOVE";
const long lRemove = wxExecute(strRemove, wxEXEC_SYNC); const long lRemove = wxExecute(strRemove, wxEXEC_SYNC);
//2) Eliminatore di precedenti servers installati come programmi in esecuzione automatica
switch (iSrvAutostartMode) switch (iSrvAutostartMode)
{ {
//esecuzione server come servizi (magia!) //esecuzione server come servizi (magia!)

View File

@ -212,8 +212,8 @@ bool WarningBox(const wxString str)
//classe per gestire i .Ini di campo //classe per gestire i .Ini di campo
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
bool CampoIniFile::GetFirstGroup(wxString& strGroup, long& nIndex) bool CampoIniFile::GetFirstGroup(wxString& strGroup, long& nIndex)
{ {
m_asGroups.Clear(); m_asGroups.Clear();
char bufferone[1024*16]; char bufferone[1024*16];
@ -232,23 +232,23 @@ bool WarningBox(const wxString str)
nIndex = 0; nIndex = 0;
return GetNextGroup(strGroup, nIndex); return GetNextGroup(strGroup, nIndex);
} }
bool CampoIniFile::GetNextGroup(wxString& strGroup, long& nIndex) bool CampoIniFile::GetNextGroup(wxString& strGroup, long& nIndex)
{ {
const bool ok = nIndex >= 0 && nIndex < (long)m_asGroups.GetCount(); const bool ok = nIndex >= 0 && nIndex < (long)m_asGroups.GetCount();
if (ok) if (ok)
strGroup = m_asGroups[nIndex++]; strGroup = m_asGroups[nIndex++];
return ok; return ok;
} }
bool CampoIniFile::DeleteGroup(const wxString strGroup) bool CampoIniFile::DeleteGroup(const wxString strGroup)
{ {
return WritePrivateProfileString(m_strGroup, NULL, NULL, m_strIniName) != 0; return WritePrivateProfileString(m_strGroup, NULL, NULL, m_strIniName) != 0;
} }
bool CampoIniFile::GetFirstEntry(wxString& strEntry, long& nIndex) bool CampoIniFile::GetFirstEntry(wxString& strEntry, long& nIndex)
{ {
m_asEntries.Clear(); m_asEntries.Clear();
char bufferone[1024*32]; char bufferone[1024*32];
@ -271,48 +271,48 @@ bool WarningBox(const wxString str)
nIndex = 0; nIndex = 0;
return GetNextEntry(strEntry, nIndex); return GetNextEntry(strEntry, nIndex);
} }
bool CampoIniFile::GetNextEntry(wxString& strEntry, long& nIndex) bool CampoIniFile::GetNextEntry(wxString& strEntry, long& nIndex)
{ {
const bool ok = nIndex >= 0 && nIndex < (long)m_asEntries.GetCount(); const bool ok = nIndex >= 0 && nIndex < (long)m_asEntries.GetCount();
if (ok) if (ok)
strEntry = m_asEntries[nIndex++]; strEntry = m_asEntries[nIndex++];
return ok; return ok;
} }
wxString CampoIniFile::Get(const wxString strVariable) const wxString CampoIniFile::Get(const wxString strVariable) const
{ {
wxString strOutString; wxString strOutString;
char* buffer = strOutString.GetWriteBuf(256); char* buffer = strOutString.GetWriteBuf(256);
GetPrivateProfileString(m_strGroup, strVariable, "", buffer, 256, m_strIniName); GetPrivateProfileString(m_strGroup, strVariable, "", buffer, 256, m_strIniName);
strOutString.UngetWriteBuf(); //sblocca la memoria senno' la stringa resta per sempre!!! strOutString.UngetWriteBuf(); //sblocca la memoria senno' la stringa resta per sempre!!!
return strOutString; return strOutString;
} }
bool CampoIniFile::GetBool(const wxString strVariable) const bool CampoIniFile::GetBool(const wxString strVariable) const
{ {
const char chVal = Get(strVariable)[0]; const char chVal = Get(strVariable)[0];
return chVal == 'X' || chVal == 'Y' || chVal == '1'; return chVal == 'X' || chVal == 'Y' || chVal == '1';
} }
int CampoIniFile::GetInt(const wxString strVariable) const int CampoIniFile::GetInt(const wxString strVariable) const
{ {
return atoi(Get(strVariable)); return atoi(Get(strVariable));
} }
bool CampoIniFile::Set(const wxString strVariable, const wxString strValue) bool CampoIniFile::Set(const wxString strVariable, const wxString strValue)
{ {
return WritePrivateProfileString(m_strGroup, strVariable, strValue, m_strIniName) != 0; return WritePrivateProfileString(m_strGroup, strVariable, strValue, m_strIniName) != 0;
} }
bool CampoIniFile::Set(const wxString strVariable, const int uValue) bool CampoIniFile::Set(const wxString strVariable, const int uValue)
{ {
wxString strValue; wxString strValue;
strValue << uValue; strValue << uValue;
return WritePrivateProfileString(m_strGroup, strVariable, strValue, m_strIniName) != 0; return WritePrivateProfileString(m_strGroup, strVariable, strValue, m_strIniName) != 0;
} }
//costruttore //costruttore
CampoIniFile::CampoIniFile(const wxString strIniPath, wxString strGroup) CampoIniFile::CampoIniFile(const wxString strIniPath, wxString strGroup)