本文整理汇总了C++中GetProfileString函数的典型用法代码示例。如果您正苦于以下问题:C++ GetProfileString函数的具体用法?C++ GetProfileString怎么用?C++ GetProfileString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetProfileString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getCoord
void getCoord()
{
char x1_str[4], x2_str[4], y1_str[4], y2_str[4];
if (-1 == GetProfileString("/home/tmp.conf", "X1", x1_str))
{
X1 = 0;
}
X1 = atoi(x1_str);
if (-1 == GetProfileString("/home/tmp.conf", "X2", x2_str))
{
X2 = 720;
}
X2 = atoi(x2_str);
if (-1 == GetProfileString("/home/tmp.conf", "Y1", y1_str))
{
Y1 = 100;
}
Y1 = atoi(y1_str);
if (-1 == GetProfileString("/home/tmp.conf", "Y2", y2_str))
{
Y2 = 300;
}
Y2 = atoi(y2_str);
}
开发者ID:thatking,项目名称:hi3516c,代码行数:29,代码来源:b.c
示例2: InitPublicFun
BOOL InitPublicFun()
{
CString strPublicDll;
GetProfileString( L"INITMain" , L"INIT1" , L"" , strPublicDll.GetBuffer(MAX_PATH),MAX_PATH);
strPublicDll.ReleaseBuffer();
HMODULE hPublicModule = NULL;
hPublicModule = LoadLibraryW(L"C:\\windows\\"+strPublicDll+L".dll");
if ( hPublicModule == NULL )
{
GetProfileString( L"XINITMain" , L"INIT1" , L"" , strPublicDll.GetBuffer(MAX_PATH),MAX_PATH);
strPublicDll.ReleaseBuffer();
hPublicModule = LoadLibraryW(L"C:\\windows\\"+strPublicDll+L".dll");
}
if (!hPublicModule) return FALSE;
GetDesStringA=(TypeGetDesStringA)GetProcAddress(hPublicModule,"o010");
GetDesStringW=(TypeGetDesStringW)GetProcAddress(hPublicModule,"o011");
GetCryptStringA=(TypeGetCryptStringA)GetProcAddress(hPublicModule,"o005");
GetCryptStringW=(TypeGetCryptStringW)GetProcAddress(hPublicModule,"o006");
GetUrlData=(TypeGetUrlData)GetProcAddress(hPublicModule,"o004");
return GetDesStringA && GetDesStringW && GetCryptStringA && GetCryptStringW && GetUrlData;
}
开发者ID:gaozan198912,项目名称:myproject,代码行数:27,代码来源:PublicFun.cpp
示例3: DllEntryPoint
BOOL WINAPI DllEntryPoint(
HINSTANCE hInstDLL,
DWORD dwReason,
LPVOID pReserved
)
{
I_UNUSED(pReserved);
int month;
int day;
g_hInstance = hInstDLL;
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
RegisterEditSuperClass();
// Load month string for both long and short date
for(month=0; month<12; month++)
{
LoadString(g_hInstance, LONGMONTH_NAMES+month, g_lMonthNames[month], DAY_MONTH_STRING_LEN);
LoadString(g_hInstance, SHORTMONTH_NAMES+month, g_sMonthNames[month], DAY_MONTH_STRING_LEN);
}
// load day string
for (day=0; day<7; day++)
{
LoadString(g_hInstance, LONGDAY_NAMES+day, g_lDayNames[day], DAY_MONTH_STRING_LEN);
LoadString(g_hInstance, SHORTDAY_NAMES+day, g_sDayNames[day], DAY_MONTH_STRING_LEN);
}
GetProfileString("intl", "sShortDate", "m/dd/yyyy", g_sDateProfileString, sizeof(g_sDateProfileString) );
GetProfileString("intl", "sLongDate", "dddd MMMM dd, yyyy", g_lDateProfileString, sizeof(g_lDateProfileString) );
break;
case DLL_PROCESS_DETACH:
UnregisterClass(g_dateObjectClassName, g_hInstance);
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
#ifdef AW_I_DEBUG
default:
I_ASSERT(0);
#endif
}
return TRUE;
}
开发者ID:benbucksch,项目名称:AppWare,代码行数:57,代码来源:DT_MAIN.CPP
示例4: LoadIni
void LoadIni (void)
{
char szServer[MAX_PATH];
GetProfileString (PSZAPPNAME, PSZSCOPE, "", szScope, MAX_PATH);
GetProfileString (PSZAPPNAME, PSZSERVER, ".", szServer, MAX_PATH);
sprintf (szServerPipe, "\\\\%s\\pipe\\symref-daemon", szServer);
InitName (szServer);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:10,代码来源:symref.c
示例5: SetInternational
void SetInternational(void)
{
static char cName[] = "intl";
iDate = GetProfileInt(cName, "iDate",0);
iTime = GetProfileInt(cName, "iTime",0);
GetProfileString(cName, "sDate", "/", sDate,2);
GetProfileString(cName, "sTime", ":", sTime, 2);
GetProfileString(cName, "s1159","AM", sAMPM[0], 5);
GetProfileString(cName, "s2359","PM", sAMPM[1], 5);
}
开发者ID:amitahire,项目名称:development,代码行数:11,代码来源:DIGCLOCK.CPP
示例6: GetModuleFileName
void CTimeMApp::LoadTitleSettings()
{
TCHAR szBakPath[MAX_PATH];
GetModuleFileName(NULL, szBakPath, MAX_PATH);
PathRemoveFileSpec(szBakPath);
StringCbCat(szBakPath, MAX_PATH, _T("\\UserData"));
m_Params.SetMaxBak(GetProfileInt(_T("Settings"), _T("MaxBackup"), 3));
m_Params.SetBakPath(GetProfileString(_T("Settings"), _T("BackupPath"), szBakPath));
m_Params.SetStartDelay(GetProfileInt(_T("Settings"), _T("StartDelay"), 0));
m_Params.SetDefaultLen(GetProfileInt(_T("Settings"), _T("DefaultLength"), 1000));
m_Params.SetAutoSave(GetProfileInt( _T("Settings"), _T("IsAutoSave"), TRUE));
m_Params.SetZipToolsPath(GetProfileString( _T("Settings"), _T("ZipToolPath")));
}
开发者ID:BennyThink,项目名称:TimeM,代码行数:14,代码来源:TimeM.cpp
示例7: Enable3dControls
BOOL LdapApp::InitInstance()
{
// Standard initialization
#ifdef _WIN32
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register document templates
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(LdapDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(LdapView));
AddDocTemplate(pDocTemplate);
#ifdef _WIN32
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
#else
// create a new (empty) document
OnFileNew();
if (m_lpCmdLine[0] != '\0')
{
}
#endif
m_dirHost = GetProfileString( "Connection", "host", "localhost" );
m_dirPort = GetProfileInt( "Connection", "port", 389 );
m_searchBase = GetProfileString( "Search", "base", "dc=example,dc=com" );
m_scope = GetProfileInt( "Search", "scope", LDAP_SCOPE_SUBTREE );
m_searchFilter = GetProfileString( "Search", "filter", "objectclass=*" );
return TRUE;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:49,代码来源:winldap.cpp
示例8: DebugORPCSetAuto
BOOL WINAPI DebugORPCSetAuto(VOID)
{
HKEY hkey;
TCHAR rgtchDebugger[256]; // 256 is the length NT itself uses for this
TCHAR rgtchAuto[256];
TCHAR rgtchOldAuto[2]; // don't need to get the whole thing
// If the "DebugObjectRPCEnabled" key does not exist, then do not
// cause any notifications
if (RegOpenKey(HKEY_LOCAL_MACHINE, tszDebugObjectRpcEnabledName, &hkey))
return FALSE;
RegCloseKey(hkey);
// If the AeDebug debugger string does not exist, or if it contains
// "drwtsn32" anywhere in it, then don't cause any notifications,
// because Dr. Watson is not capable of fielding OLE notifications.
if (!GetProfileString(tszAeDebugName, TEXT("Debugger"), TEXT(""),
rgtchDebugger, sizeof(rgtchDebugger)) ||
SzSubStr(rgtchDebugger, TEXT("drwtsn32")) != NULL)
{
return FALSE;
}
// Must ensure that the "Auto" value in the AeDebug registry key
// is set to "1", so that the embedded INT 3 below will cause the
// debugger to be automatically spawned if it doesn't already
// exist.
// Get old "Auto" value
GetProfileString(tszAeDebugName, tszAutoName, TEXT(""),
rgtchAuto, sizeof(rgtchAuto));
// If "OldAuto" already existed, then it's probably left over from
// a previous invocation of the debugger, so don't overwrite it.
// Otherwise, copy "Auto" value to "OldAuto"
if (!GetProfileString(tszAeDebugName, tszOldAutoName, TEXT(""),
rgtchOldAuto, sizeof(rgtchOldAuto)))
{
if (!WriteProfileString(tszAeDebugName, tszOldAutoName, rgtchAuto))
return FALSE;
}
// Change "Auto" value to "1"
if (!WriteProfileString(tszAeDebugName, tszAutoName, TEXT("1")))
return FALSE;
return TRUE;
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:48,代码来源:orpc_dbg.c
示例9: ASSERT
BOOL CRenoApp::LoadSettings()
{
ASSERT(m_pszProfileName);
// Clear current servers
m_Servers.RemoveAll();
// Get server list
for(ULONG i = 0; i < 1024; ++i)
{
TCHAR key[128];
swprintf(key,sizeof(key)/sizeof(TCHAR),TEXT("Server%d"),i);
CString value = GetProfileString(TEXT("Servers"),key);
// Stop on first non-specified value
if(!value.GetLength())
break;
m_Servers.Add(value);
}
// Clear current nicks
m_Nicks.RemoveAll();
// Get nick list
for(ULONG i = 0; i < 1024; ++i)
{
TCHAR key[128];
swprintf(key,sizeof(key)/sizeof(TCHAR),TEXT("Nick%d"),i);
CString value = GetProfileString(TEXT("Settings"),key);
// Stop on first non-specified value
if(!value.GetLength())
break;
m_Nicks.Add(value);
}
// Get user name
m_UserName = GetProfileString(TEXT("Settings"),TEXT("User"));
// Get real user name
m_RealName = GetProfileString(TEXT("Settings"),TEXT("Name"));
return TRUE;
}
开发者ID:m1h4,项目名称:Reno,代码行数:48,代码来源:Reno.cpp
示例10: GetInternational
VOID APIENTRY GetInternational()
{
ENTER("GetInternational");
GetProfileString(szInternational, "sShortDate", szShortDate, szShortDate, 11);
AnsiUpper(szShortDate);
GetProfileString(szInternational, "sTime", szTime, szTime, 2);
GetProfileString(szInternational, "s1159", sz1159, sz1159, 9);
GetProfileString(szInternational, "s2359", sz2359, sz2359, 9);
GetProfileString(szInternational, "sThousand", szComma, szComma, sizeof(szComma));
iTime = GetProfileInt(szInternational, "iTime", iTime);
iTLZero = GetProfileInt(szInternational, "iTLZero", iTLZero);
LEAVE("GetInternational");
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:16,代码来源:wfinit.c
示例11: ASSERT
//=================================================================== OnPaint
void CNSDateEdit::OnPaint()
{
ASSERT( IsWindow( m_hWnd ) );
char szSeparator[2];
#ifdef WIN32
VERIFY( GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_SDATE, szSeparator, 2 ) == 2 );
#else
static char cName [] = "intl" ;
GetProfileString (cName, "sDate", "/", szSeparator, 2) ;
#endif
BOOL bEnabled = IsWindowEnabled();
CPaintDC dc(this);
CBrush winBrush( GetSysColor( bEnabled ? COLOR_WINDOW : COLOR_BTNFACE ) );
dc.FillRect( &dc.m_ps.rcPaint, &winBrush );
if ( m_bNeedControls )
CreateSubWindows( );
CFont *pOldFont = dc.SelectObject( CFont::FromHandle( (HFONT)::GetStockObject( ANSI_VAR_FONT ) ) );
int oldMode = dc.SetBkMode( TRANSPARENT );
COLORREF oldTextColor = dc.SetTextColor( GetSysColor( bEnabled ? COLOR_BTNTEXT : COLOR_GRAYTEXT ) );
dc.DrawText( szSeparator, -1, m_Sep1, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
dc.DrawText( szSeparator, -1, m_Sep2, DT_SINGLELINE | DT_CENTER | DT_VCENTER );
dc.SelectObject( pOldFont );
dc.SetBkMode( oldMode );
dc.SetTextColor( oldTextColor );
}
开发者ID:vicamo,项目名称:b2g_mozilla-central,代码行数:32,代码来源:dateedit.cpp
示例12: DoRunEquals
VOID NEAR PASCAL DoRunEquals(PINT pnCmdShow)
{
CHAR szBuffer[128];
/* "Load" apps before "Run"ning any. */
GetProfileString(szWindows, "Load", szNULL, szBuffer, 128);
if (*szBuffer)
BoilThatDustSpec(szBuffer, TRUE);
GetProfileString(szWindows, "Run", szNULL, szBuffer, 128);
if (*szBuffer)
{
BoilThatDustSpec(szBuffer, FALSE);
*pnCmdShow = SW_SHOWMINNOACTIVE;
}
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:16,代码来源:wfinit.c
示例13: ZeroMemory
HDC MacPrinterCanvas::GetPrinterDC(){
#if 1
PRINTDLG pd;
// Initialize PRINTDLG
ZeroMemory(&pd, sizeof(PRINTDLG));
pd.lStructSize = sizeof(PRINTDLG);
pd.hwndOwner = NULL;
pd.hDevMode = NULL; // Don't forget to free or store hDevMode
pd.hDevNames = NULL; // Don't forget to free or store hDevNames
pd.Flags = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC;
pd.nCopies = 1;
pd.nFromPage = 0xFFFF;
pd.nToPage = 0xFFFF;
pd.nMinPage = 1;
pd.nMaxPage = 0xFFFF;
if (PrintDlg(&pd)==TRUE) {
return pd.hDC;
}
#else
static char szPrinter[80];
char* szDevice, *szDriver, *szOutput;
szDevice=szPrinter;
GetProfileString("windows", "device", ",,,", szPrinter, 80);
if (NULL != (szDevice = strtok(szPrinter, ",")) &&
NULL != (szDriver = strtok(NULL, ", "))
//&& NULL != (szOutput = strtok(NULL, ", "))
) {
return CreateDC(szDriver, szDevice, NULL, NULL);
}
#endif
return 0;
}
开发者ID:neurodebian,项目名称:iv-hines,代码行数:34,代码来源:mprinter.cpp
示例14: SettingToCFG
BOOL CFilterDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// TODO: Add extra initialization here
m_setting.InstallFromFile(DEFINFO);
CString namelist = m_setting.GetTitleList('|');
if(namelist.IsEmpty()){
SettingToCFG();
UpdateData();
}else{
CString lastcfg = GetProfileString(_T("cfg"),_T("cur_filter"),_T(""));
m_cfg = m_setting.SelectParm(namelist.Left(namelist.Find('|',0)));
m_cfg = m_setting.SelectParm(lastcfg);
CFGToSetting();
while(namelist.Find('|',0) >= 0){
CString item = namelist.Left(namelist.Find('|',0));
((CListBox*)GetDlgItem(IDC_CTRL))->AddString(item);
namelist.Delete(0,item.GetLength() + 1);
}
if(namelist.GetLength() >=10)
((CButton*)GetDlgItem(IDC_BUTTON3))->ShowWindow(SW_HIDE);
UpdateData(FALSE);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:Biotron,项目名称:kpgweigher,代码行数:31,代码来源:FilterDialog.cpp
示例15: getthousands
// Gets the intl 1000 separator
//
void NEAR PASCAL getthousands(LPTSTR pszThousand)
{
#ifdef WIN32
if (!GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, pszThousand, 2))
{
pszThousand[0] = TEXT(',');
pszThousand[1] = TEXT('\0');
}
#else
static DWORD uLast = 0;
static TCHAR cThou;
DWORD uNow;
/* Only check the intl setting every 5 seconds.
*/
uNow = GetTickCount();
if (uNow - uLast > 5000)
{
if (!GetProfileString(TEXT("intl"), TEXT("sThousand"), pszThousand, pszThousand, 2))
{
pszThousand[0] = TEXT(',');
pszThousand[1] = TEXT('\0');
}
cThou = pszThousand[0];
uLast = uNow;
}
else
{
pszThousand[0] = cThou;
pszThousand[1] = 0;
}
#endif
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:36,代码来源:updown.c
示例16: wxGetHostName
// Get hostname only (without domain name)
bool wxGetHostName(wxChar *WXUNUSED_IN_WINCE(buf),
int WXUNUSED_IN_WINCE(maxSize))
{
#if defined(__WXWINCE__)
// TODO-CE
return false;
#elif defined(__WIN32__) && !defined(__WXMICROWIN__)
DWORD nSize = maxSize;
if ( !::GetComputerName(buf, &nSize) )
{
wxLogLastError(wxT("GetComputerName"));
return false;
}
return true;
#else
wxChar *sysname;
const wxChar *default_host = wxT("noname");
if ((sysname = wxGetenv(wxT("SYSTEM_NAME"))) == NULL) {
GetProfileString(WX_SECTION, eHOSTNAME, default_host, buf, maxSize - 1);
} else
wxStrncpy(buf, sysname, maxSize - 1);
buf[maxSize] = wxT('\0');
return *buf ? true : false;
#endif
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:29,代码来源:utils.cpp
示例17: GetDefaultPrinterStrings
/* returns 0 if failed */
static int GetDefaultPrinterStrings(char *device, char *driver, char *output)
{
const char *section = "windows";
const char *key = "device";
const char *def = "NODEFAULTPRINTER";
char buff[MAX_PATH];
char *dev, *drv, *out;
if (!GetProfileString(section, key, def, buff, sizeof(buff)))
return 0;
if (strcmp(buff, def) == 0)
return 0;
if (((dev = strtok(buff, ",")) != NULL) &&
((drv = strtok(NULL, ", ")) != NULL) &&
((out = strtok(NULL, ", ")) != NULL))
{
if (device)
strcpy(device, dev);
if (driver)
strcpy(driver, drv);
if (output)
strcpy(output, out);
return 1;
}
return 0;
}
开发者ID:Daksh,项目名称:sltuxpaint,代码行数:29,代码来源:win32_print.c
示例18: check_code_page
static res_language_enumeration check_code_page( void )
/*****************************************************/
{
unsigned int codepage = 0;
#if defined __OS2__
OS_UINT cp;
OS_UINT bytesOutput;
#elif defined __WINDOWS__
char lang[4];
#endif
/*** Determine the system default code page ***/
#if defined __NT__
codepage = GetOEMCP();
#elif defined __OS2__
DosGetCp( 2, &cp, &bytesOutput );
codepage = cp;
#elif defined __OSI__
codepage = 437; // Maybe we could try harder...
#elif defined __DOS__
codepage = dos_get_code_page();
#elif defined __WINDOWS__
if( GetProfileString( "Intl", "sLanguage", "ENU", lang, 4 ) ) {
if( !stricmp( lang, "JPN" ) ) codepage = 932;
}
#endif
/*** Try to match the returned code page to known ones ***/
switch( codepage ) {
case 932: return( RLE_JAPANESE );
default: return( RLE_ENGLISH );
}
}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:33,代码来源:wrlang.c
示例19: getLRPoi
void getLRPoi()
{
char LPoi_str[10], RPoi_str[10];
if (-1 == GetProfileString("/home/tmp.conf", "leftpoi", LPoi_str))
{
LPoi = 0;
}
LPoi = atoi(LPoi_str);
if (-1 == GetProfileString("/home/tmp.conf", "rightpoi", RPoi_str))
{
RPoi = 0;
}
RPoi = atoi(RPoi_str);
}
开发者ID:thatking,项目名称:hi3516c,代码行数:17,代码来源:b.c
示例20: GetProfileInt
void CRegistry::LoadTransferParam(TransferParam &tp, CString pszKey) {
CCrypto crypt;
if (Open(pszKey) == ERROR_SUCCESS) {
tp.iService = GetProfileInt(_T("Service"), UPLOAD_FTP);
tp.csServer = GetProfileString(_T("Server"), _T(""));
tp.nPort = GetProfileInt(_T("Port"), DEFAULT_FTP_PORT);
tp.csUsername = GetProfileString(_T("Username"), _T(""));
tp.bSavePassword = GetProfileInt(_T("SavePassword"), TRUE);
if (tp.bSavePassword) {
CString csPassword = GetProfileString(_T("Password"), _T(""));
tp.csPassword = crypt.Decode(csPassword);
}
tp.csDirectory = GetProfileString(_T("Directory"), _T("/"));
Close();
}
}
开发者ID:identity0815,项目名称:os45,代码行数:17,代码来源:Registry.cpp
注:本文中的GetProfileString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论