本文整理汇总了C++中LPIDENT::GetLongServerName方法的典型用法代码示例。如果您正苦于以下问题:C++ LPIDENT::GetLongServerName方法的具体用法?C++ LPIDENT::GetLongServerName怎么用?C++ LPIDENT::GetLongServerName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPIDENT
的用法示例。
在下文中一共展示了LPIDENT::GetLongServerName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPreferencesInfo
BOOL GetPreferencesInfo (LPIDENT lpi, LPTSTR pszPath, WORD *pwVer)
{
if (lpi == NULL)
return FALSE;
// HKCU\Software\...\SVRMgr + \CellName
//
lstrcpy (pszPath, REGSTR_SETTINGS_PREFS);
lstrcat (pszPath, TEXT("\\"));
lpi->GetCellName (&pszPath[ lstrlen(pszPath) ]);
// HKCU\Software\...\SVRMgr\CellName + \ServerName
//
lstrcat (pszPath, TEXT("\\"));
lpi->GetLongServerName (&pszPath[ lstrlen(pszPath) ]);
*pwVer = wVerSERVER_PREF;
if (lpi->fIsService())
{
// HKCU\Software\...\SVRMgr\CellName\ServerName + \Services\ServiceName
//
lstrcat (pszPath, TEXT("\\"));
lstrcat (pszPath, SERVICES_KW);
lstrcat (pszPath, TEXT("\\"));
lpi->GetServiceName (&pszPath[ lstrlen(pszPath) ]);
*pwVer = wVerSERVICE_PREF;
}
else if (lpi->fIsAggregate())
{
// HKCU\Software\...\SVRMgr\CellName\ServerName + \Aggs\AggregateName
//
lstrcat (pszPath, TEXT("\\"));
lstrcat (pszPath, AGGREGATES_KW);
lstrcat (pszPath, TEXT("\\"));
lpi->GetAggregateName (&pszPath[ lstrlen(pszPath) ]);
*pwVer = wVerAGGREGATE_PREF;
}
else if (lpi->fIsFileset())
{
// HKCU\Software\...\SVRMgr\CellName\ServerName + \Filesets\FilesetName
//
lstrcat (pszPath, TEXT("\\"));
lstrcat (pszPath, FILESETS_KW);
lstrcat (pszPath, TEXT("\\"));
lpi->GetFilesetName (&pszPath[ lstrlen(pszPath) ]);
*pwVer = wVerFILESET_PREF;
}
return TRUE;
}
示例2: Subsets_fMonitorServer
BOOL Subsets_fMonitorServer (LPSUBSET sub, LPIDENT lpiServer)
{
BOOL fMonitor = TRUE;
TCHAR szLong[ cchNAME ];
TCHAR szShort[ cchNAME ];
lpiServer->GetLongServerName (szLong);
lpiServer->GetShortServerName (szShort);
if (sub)
{
if (sub->pszMonitored)
{
fMonitor = FALSE; // unless it shows up here.
for (LPTSTR psz = sub->pszMonitored; !fMonitor && *psz; psz += 1+lstrlen(psz))
{
if (!lstrcmpi (psz, szLong))
fMonitor = TRUE;
else if (!lstrcmpi (psz, szShort))
fMonitor = TRUE;
}
}
else if (sub->pszUnmonitored)
{
for (LPTSTR psz = sub->pszUnmonitored; fMonitor && *psz; psz += 1+lstrlen(psz))
{
if (!lstrcmpi (psz, szLong))
fMonitor = FALSE;
else if (!lstrcmpi (psz, szShort))
fMonitor = FALSE;
}
}
}
return fMonitor;
}
示例3: Subsets_SetMonitor
LPSUBSET Subsets_SetMonitor (LPSUBSET sub, LPIDENT lpiServer, BOOL fMonitor)
{
if (sub == NULL)
{
sub = New (SUBSET);
memset (sub, 0x00, sizeof(SUBSET));
}
if (fMonitor != Subsets_fMonitorServer (sub, lpiServer))
{
sub->fModified = TRUE;
TCHAR szLong[ cchNAME ];
TCHAR szShort[ cchNAME ];
lpiServer->GetShortServerName (szShort);
lpiServer->GetLongServerName (szLong);
// First ensure that the server name doesn't appear anywhere
// in the subset.
//
LPTSTR pszMonitoredNew = NULL;
LPTSTR pszUnmonitoredNew = NULL;
if (sub->pszMonitored)
{
for (LPTSTR psz = sub->pszMonitored; *psz; psz += 1+lstrlen(psz))
{
if (lstrcmpi (psz, szLong) && lstrcmpi (psz, szShort))
{
FormatMultiString (&pszMonitoredNew, TRUE, TEXT("%1"), TEXT("%s"), psz);
}
}
}
else if (sub->pszUnmonitored)
{
for (LPTSTR psz = sub->pszUnmonitored; *psz; psz += 1+lstrlen(psz))
{
if (lstrcmpi (psz, szLong) && lstrcmpi (psz, szShort))
{
FormatMultiString (&pszUnmonitoredNew, TRUE, TEXT("%1"), TEXT("%s"), psz);
}
}
}
// Then ensure it shows up only where necessary.
//
if (sub->pszMonitored && fMonitor)
{
FormatMultiString (&pszMonitoredNew, TRUE, TEXT("%1"), TEXT("%s"), szLong);
}
else if (!sub->pszMonitored && !fMonitor)
{
FormatMultiString (&pszUnmonitoredNew, TRUE, TEXT("%1"), TEXT("%s"), szLong);
}
if (sub->pszMonitored && !pszMonitoredNew)
{
pszMonitoredNew = AllocateString (2);
pszMonitoredNew[0] = TEXT('\0');
pszMonitoredNew[1] = TEXT('\0');
}
if (sub->pszUnmonitored && !pszUnmonitoredNew)
{
pszUnmonitoredNew = AllocateString (2);
pszUnmonitoredNew[0] = TEXT('\0');
pszUnmonitoredNew[1] = TEXT('\0');
}
// Finally, update the subset's members.
//
if (sub->pszMonitored)
FreeString (sub->pszMonitored);
if (sub->pszUnmonitored)
FreeString (sub->pszUnmonitored);
sub->pszMonitored = pszMonitoredNew;
sub->pszUnmonitored = pszUnmonitoredNew;
}
return sub;
}