您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetPrivateProfileStringW函数代码示例

51自学网 2021-06-01 21:13:29
  C++
这篇教程C++ GetPrivateProfileStringW函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetPrivateProfileStringW函数的典型用法代码示例。如果您正苦于以下问题:C++ GetPrivateProfileStringW函数的具体用法?C++ GetPrivateProfileStringW怎么用?C++ GetPrivateProfileStringW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetPrivateProfileStringW函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: get_profile_string

/* A helper function:  Allocate and fill rString.  Return number of bytes read. */static DWORD get_profile_string(LPCWSTR lpAppName, LPCWSTR lpKeyName,                                LPCWSTR lpFileName, WCHAR **rString ){    DWORD r = 0;    DWORD len = 128;    WCHAR *buffer;    buffer = CoTaskMemAlloc(len * sizeof(*buffer));    if (buffer != NULL)    {        r = GetPrivateProfileStringW(lpAppName, lpKeyName, NULL, buffer, len, lpFileName);        while (r == len-1)        {            WCHAR *realloc_buf;            len *= 2;            realloc_buf = CoTaskMemRealloc(buffer, len * sizeof(*buffer));            if (realloc_buf == NULL)            {                CoTaskMemFree(buffer);                *rString = NULL;                return 0;            }            buffer = realloc_buf;            r = GetPrivateProfileStringW(lpAppName, lpKeyName, NULL, buffer, len, lpFileName);        }    }    *rString = buffer;    return r;}
开发者ID:Barrell,项目名称:wine,代码行数:33,


示例2: swprintf

void PipeReader::init(wchar_t *section) {	wchar_t temp[300];	swprintf(temp,L"SCardSimulatorDriver%i",instance);	GetPrivateProfileStringW(section,L"PIPE_NAME",temp,pipeName,300,L"BixVReader.ini");	swprintf(temp,L"SCardSimulatorDriverEvents%i",instance);	GetPrivateProfileStringW(section,L"PIPE_EVENT_NAME",temp,pipeEventName,300,L"BixVReader.ini");}
开发者ID:frankmorgner,项目名称:vsmartcard,代码行数:8,


示例3: PersistFile_Load

static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileName, DWORD dwMode){    WCHAR str_header[] = {'I','n','t','e','r','n','e','t','S','h','o','r','t','c','u','t',0};    WCHAR str_URL[] = {'U','R','L',0};    WCHAR *filename = NULL;    HRESULT hr;    InternetShortcut *This = impl_from_IPersistFile(pFile);    TRACE("(%p, %s, 0x%x)/n", pFile, debugstr_w(pszFileName), dwMode);    if (dwMode != 0)        FIXME("ignoring unimplemented mode 0x%x/n", dwMode);    filename = co_strdupW(pszFileName);    if (filename != NULL)    {        DWORD len = 128;        DWORD r;        WCHAR *url = CoTaskMemAlloc(len*sizeof(WCHAR));        if (url != NULL)        {            r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName);            while (r == len-1)            {                CoTaskMemFree(url);                len *= 2;                url = CoTaskMemAlloc(len*sizeof(WCHAR));                if (url == NULL)                    break;                r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName);            }            if (r == 0)                hr = E_FAIL;            else if (url != NULL)            {                CoTaskMemFree(This->currentFile);                This->currentFile = filename;                CoTaskMemFree(This->url);                This->url = url;                This->isDirty = FALSE;                return S_OK;            }            else                hr = E_OUTOFMEMORY;            CoTaskMemFree(url);        }        else            hr = E_OUTOFMEMORY;        CoTaskMemFree(filename);    }    else        hr = E_OUTOFMEMORY;    return hr;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:51,


示例4: install_inf_file

static HRESULT install_inf_file(install_ctx_t *ctx){    WCHAR buf[2048], sect_name[128];    BOOL default_install = TRUE;    const WCHAR *key;    DWORD len;    HRESULT hres;    static const WCHAR setup_hooksW[] = {'S','e','t','u','p',' ','H','o','o','k','s',0};    static const WCHAR add_codeW[] = {'A','d','d','.','C','o','d','e',0};    len = GetPrivateProfileStringW(setup_hooksW, NULL, NULL, buf, sizeof(buf)/sizeof(*buf), ctx->install_file);    if(len) {        default_install = FALSE;        for(key = buf; *key; key += strlenW(key)+1) {            TRACE("[Setup Hooks] key: %s/n", debugstr_w(key));            len = GetPrivateProfileStringW(setup_hooksW, key, NULL, sect_name, sizeof(sect_name)/sizeof(*sect_name),                    ctx->install_file);            if(!len) {                WARN("Could not get key value/n");                return E_FAIL;            }            hres = process_hook_section(ctx, sect_name);            if(FAILED(hres))                return hres;        }    }    len = GetPrivateProfileStringW(add_codeW, NULL, NULL, buf, sizeof(buf)/sizeof(*buf), ctx->install_file);    if(len) {        FIXME("[Add.Code] section not supported/n");        /* Don't throw an error if we successfully ran setup hooks;           installation is likely to be complete enough */        if(default_install)            return E_NOTIMPL;    }    if(default_install) {        hres = RunSetupCommandW(ctx->hwnd, ctx->install_file, NULL, ctx->tmp_dir, NULL, NULL, RSC_FLAG_INF, NULL);        if(FAILED(hres)) {            WARN("RunSetupCommandW failed: %08x/n", hres);            return hres;        }    }    return S_OK;}
开发者ID:Kelimion,项目名称:wine,代码行数:51,


示例5: GetPrivateProfileStringW

void CConfigFileHandler::ReadFromCfgFileForAll(	CString& HexFileName,	CString& FlashMethod,	CString& DeviceID,	CString& COMPORT,	CString& BD,	CString& IP,	CString& IPPort,	CString& subnote,	CString& subID){	//ASSERT(m_pFile);	  	//ReadFromCfgFile();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgLastFlashFileItem),L"",HexFileName.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	HexFileName.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgLastFlashMethodItem),L"",FlashMethod.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	FlashMethod.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgDefaultAddrItem),L"",DeviceID.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	DeviceID.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgDefaultComItem),L"",COMPORT.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	COMPORT.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgDefaultIPItem),L"",IP.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	IP.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgDefaultIPPortItem),L"",IPPort.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	IPPort.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgDefaultBaudrateItem),L"",BD.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	BD.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgNote),L"",subnote.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	subnote.ReleaseBuffer();	GetPrivateProfileStringW(m_ISPTool_Section,CString(c_strCfgSubID),L"",subID.GetBuffer(MAX_PATH),MAX_PATH,m_configfile_path);	subID.ReleaseBuffer();// 	HexFileName = m_szCfgFile[CV_TstatLastFlashFile];// 	FlashMethod = m_szCfgFile[CV_TstatLastFlashMethod];// 	DeviceID = m_szCfgFile[CV_TstatDeAddr];// 	COMPORT = m_szCfgFile[CV_TstatDeCOM];	// 	BD = m_szCfgFile[CV_TstatDeBaudrate];	// 	IP=m_szCfgFile[CV_NCDeIP];// 	IPPort=m_szCfgFile[CV_NCDeIPPort];// 	subnote = m_szCfgFile[CV_SubNot];// 	subID =  m_szCfgFile[CV_Sub_ID];	// 取有效数据	//TCHAR c = ':';	// 	//HexFileName=HexFileName.Mid(HexFileName.Find(c)+2);	//FlashMethod=FlashMethod.Mid(FlashMethod.Find(c)+2);	//DeviceID=DeviceID.Mid(DeviceID.Find(c)+2);	// COMPORT=COMPORT.Mid(2);	//BD=BD.Mid(BD.Find(c)+2);	//IP=IP.Mid(IP.Find(c)+2);	//IPPort=IPPort.Mid(IPPort.Find(c)+2);	//subnote = subnote.Mid(subnote.Find(c)+2);	//subID = subID.Mid(subID.Find(c)+2);}
开发者ID:Fance,项目名称:T3000_Building_Automation_System,代码行数:55,


示例6: DRIVER_GetLibName

/************************************************************************** *				DRIVER_GetLibName		[internal] * */BOOL	DRIVER_GetLibName(LPCWSTR keyName, LPCWSTR sectName, LPWSTR buf, int sz){    HKEY	hKey, hSecKey;    DWORD	bufLen, lRet;    static const WCHAR wszSystemIni[] = {'S','Y','S','T','E','M','.','I','N','I',0};    WCHAR       wsznull = '/0';    /* This takes us as far as Windows NT/CurrentVersion */    lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, HKLM_BASE, 0, KEY_QUERY_VALUE, &hKey);    if (lRet == ERROR_SUCCESS)    {        /* Now we descend into the section name that we were given */	    lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey);	    if (lRet == ERROR_SUCCESS)        {            /* Retrieve the desired value - this is the filename of the lib */            bufLen = sz;	        lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen);	        RegCloseKey( hSecKey );	    }        RegCloseKey( hKey );    }    /* Finish up if we've got what we want from the registry */    if (lRet == ERROR_SUCCESS)        return TRUE;    /* default to system.ini if we can't find it in the registry,     * to support native installations where system.ini is still used */    return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz / sizeof(WCHAR), wszSystemIni);}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:38,


示例7: Spelling_OnInitDialog

static BOOL Spelling_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam){	PSUGGARRAY		psa = (PSUGGARRAY)lParam;	int				index;	wchar_t			szBuffer[512];	g_hSpellChecking = hwnd;	if(psa->pSuggs){		SetPropW(hwnd, EDIT_PROP, (HANDLE)psa->hEdit);		for(int i = 0; i < psa->count; i++){			index = SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_ADDSTRING, 0, (LPARAM)psa->pSuggs[i]->word);			SendDlgItemMessageW(hwnd, IDC_LST_MISPRINTS, LB_SETITEMDATA, index, (LPARAM)psa->pSuggs[i]);		}	}	GetPrivateProfileStringW(L"options", L"1052", L"Spell checking", szBuffer, 256, g_NotePaths.CurrLanguagePath);	SetWindowTextW(hwnd, szBuffer);	SetDlgCtlText(hwnd, IDCANCEL, g_NotePaths.CurrLanguagePath, L"Cancel");	SetDlgCtlText(hwnd, IDC_ST_NOT_IN_DICT, g_NotePaths.CurrLanguagePath, L"Not in dictionary");	SetDlgCtlText(hwnd, IDC_ST_SUGGESTIONS, g_NotePaths.CurrLanguagePath, L"Suggestions");	SetDlgCtlText(hwnd, IDC_CMD_IGNORE_ONCE, g_NotePaths.CurrLanguagePath, L"Ignore once");	SetDlgCtlText(hwnd, IDC_CMD_IGNORE_ALL, g_NotePaths.CurrLanguagePath, L"Ignore all");	SetDlgCtlText(hwnd, IDC_CMD_ADD_TO_DICT, g_NotePaths.CurrLanguagePath, L"Add to dictionary");	SetDlgCtlText(hwnd, IDC_CMD_CHANGE_ONCE, g_NotePaths.CurrLanguagePath, L"Change");	SetDlgCtlText(hwnd, IDC_CMD_CHANGE_ALL, g_NotePaths.CurrLanguagePath, L"Change all");	return TRUE;}
开发者ID:lunakid,项目名称:PNotesz,代码行数:27,


示例8: LoadCredentails

void LoadCredentails(const std::wstring& library, std::wstring& userName, std::wstring& password){    std::wstring configFileName = (const wchar_t*)_bstr_t(MWGetApplicationPath().c_str());    configFileName.append(L"dominodoc.ini");    //char configFileName[_MAX_PATH] = {0};    //::sprintf(configFileName, "%sdominodoc.ini", TEST_PATH_MAKE_ABSOLUTE(L"Win32//Debug//"));    wchar_t value[_MAX_PATH] = {0};    GetPrivateProfileStringW(library.c_str(), L"userid", NULL, value, _MAX_PATH, configFileName.c_str());    userName = value;    ZeroMemory(value, sizeof(value));    GetPrivateProfileStringW(library.c_str(), L"password", NULL, value, _MAX_PATH, configFileName.c_str());    password = EncryptPassword(false, value);}
开发者ID:killbug2004,项目名称:WSProf,代码行数:16,


示例9: GetModuleFileNameW

void BaseTest::MakeRootPath(LPWSTR path, LPCWSTR name){	WCHAR filename[MAX_PATH];	if (0 == path[0])	{		GetModuleFileNameW(NULL, filename, MAX_PATH);		PathRemoveFileSpecW(filename);		PathAppendW(filename, L"UnitTests.ini");		lstrcpynW(path, filename, MAX_PATH);		PathRemoveFileSpecW(path);		// bin/vc80/debug/tests		PathRemoveFileSpecW(path);		// bin/vc80/debug		PathRemoveFileSpecW(path);		// bin/vc80		PathRemoveFileSpecW(path);		// bin		PathAppendW(path, name);		// bin/name		GetPrivateProfileStringW(L"Path", name, path, 			path, MAX_PATH, filename);		PathAddBackslashW(path);		SetFileAttributesW(filename, FILE_ATTRIBUTE_NORMAL);		WritePrivateProfileStringW(L"Path", name, path, filename);	}}
开发者ID:thinkhy,项目名称:x3c_extension,代码行数:25,


示例10: ACTION_AppSearchIni

static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig){    static const WCHAR query[] =  {        's','e','l','e','c','t',' ','*',' ',        'f','r','o','m',' ',        'I','n','i','L','o','c','a','t','o','r',' ',        'w','h','e','r','e',' ',        'S','i','g','n','a','t','u','r','e','_',' ','=',' ','/'','%','s','/'',0};    MSIRECORD *row;    LPWSTR fileName, section, key;    int field, type;    WCHAR buf[MAX_PATH];    TRACE("%s/n", debugstr_w(sig->Name));    *appValue = NULL;    row = MSI_QueryGetRecord( package->db, query, sig->Name );    if (!row)    {        TRACE("failed to query IniLocator for %s/n", debugstr_w(sig->Name));        return ERROR_SUCCESS;    }    fileName = msi_dup_record_field(row, 2);    section = msi_dup_record_field(row, 3);    key = msi_dup_record_field(row, 4);    field = MSI_RecordGetInteger(row, 5);    type = MSI_RecordGetInteger(row, 6);    if (field == MSI_NULL_INTEGER)        field = 0;    if (type == MSI_NULL_INTEGER)        type = 0;    GetPrivateProfileStringW(section, key, NULL, buf, MAX_PATH, fileName);    if (buf[0])    {        switch (type & 0x0f)        {        case msidbLocatorTypeDirectory:            ACTION_SearchDirectory(package, sig, buf, 0, appValue);            break;        case msidbLocatorTypeFileName:            *appValue = app_search_file(buf, sig);            break;        case msidbLocatorTypeRawValue:            *appValue = get_ini_field(buf, field);            break;        }    }    msi_free(fileName);    msi_free(section);    msi_free(key);    msiobj_release(&row->hdr);    return ERROR_SUCCESS;}
开发者ID:pstrealer,项目名称:wine,代码行数:60,


示例11: CliGetPreloadKeyboardLayouts

VOID CliGetPreloadKeyboardLayouts(FE_KEYBOARDS* pFeKbds){    UINT  i;    WCHAR szPreLoadee[4];   // up to 999 preloads    WCHAR lpszName[KL_NAMELENGTH];    UNICODE_STRING UnicodeString;    HKL hkl;    for (i = 1; i < 1000; i++) {        wsprintf(szPreLoadee, L"%d", i);        if ((GetPrivateProfileStringW(                 L"Preload",                 szPreLoadee,                 L"",                            // default = NULL                 lpszName,                       // output buffer                 KL_NAMELENGTH,                 L"keyboardlayout.ini") == -1 ) || (*lpszName == L'/0')) {            break;        }        RtlInitUnicodeString(&UnicodeString, lpszName);        RtlUnicodeStringToInteger(&UnicodeString, 16L, (PULONG)&hkl);        RIPMSG2(RIP_VERBOSE, "PreLoaded HKL(%d): %08X/n", i, hkl);        //        // Set language flags. By its definition, LOWORD(hkl) is LANGID        //        SetFeKeyboardFlags(LOWORD(HandleToUlong(hkl)), pFeKbds);    }}
开发者ID:conioh,项目名称:os-design,代码行数:30,


示例12: config_load_w

BOOL config_load_w(HMODULE module,CONFIG_BINDING_W* binding){	wchar_t path[MAX_PATH];	GetModuleFileNameW(module,path,MAX_PATH);	for(int i=wcslen(path)-1;i>=0;i--){		if(path[i]==L'//'){			path[i]=L'/0';			break;		}	}	wcscat(path,L"//config.ini");	PCONFIG_BINDING_W b;	int i=0;	wchar_t buffer[32767];	int l;	while((b=binding+(i++))->section){		switch(b->type){			case CONFIG_TYPE_STRING:				l = GetPrivateProfileStringW(b->section,b->key,b->def.asString,buffer,32767,path);				if(buffer[0]==0&&b->def.asString==NULL){					*(b->val.asString)=NULL;				}else{					*(b->val.asString)=(wchar_t*)malloc(sizeof(wchar_t)*(wcslen(buffer)+1));					wcscpy(*(b->val.asString),buffer);				}				break;			case CONFIG_TYPE_INT:				*(b->val.asInt) = GetPrivateProfileIntW(b->section,b->key,b->def.asInt,path);				break;		}	}	return TRUE;}
开发者ID:pengjiang80,项目名称:win32-dhcp-filter-and-logger,代码行数:32,


示例13: DRIVER_GetLibName

/************************************************************************** *				DRIVER_GetLibName		[internal] * */BOOL	DRIVER_GetLibName(LPCWSTR keyName, LPCWSTR sectName, LPWSTR buf, int sz){    HKEY	hKey, hSecKey;    DWORD	bufLen, lRet;    static const WCHAR wszSystemIni[] = {'S','Y','S','T','E','M','.','I','N','I',0};    WCHAR       wsznull = '/0';    TRACE("registry: %s, %s, %p, %d/n", debugstr_w(keyName), debugstr_w(sectName), buf, sz);    lRet = RegOpenKeyExW(HKEY_LOCAL_MACHINE, HKLM_BASE, 0, KEY_QUERY_VALUE, &hKey);    if (lRet == ERROR_SUCCESS) {	lRet = RegOpenKeyExW(hKey, sectName, 0, KEY_QUERY_VALUE, &hSecKey);	if (lRet == ERROR_SUCCESS) {            bufLen = sz;	    lRet = RegQueryValueExW(hSecKey, keyName, 0, 0, (void*)buf, &bufLen);	    RegCloseKey( hSecKey );	}        RegCloseKey( hKey );    }    if (lRet == ERROR_SUCCESS) return TRUE;    /* default to system.ini if we can't find it in the registry,     * to support native installations where system.ini is still used */    TRACE("system.ini: %s, %s, %p, %d/n", debugstr_w(keyName), debugstr_w(sectName), buf, sz);    return GetPrivateProfileStringW(sectName, keyName, &wsznull, buf, sz / sizeof(WCHAR), wszSystemIni);}
开发者ID:mikekap,项目名称:wine,代码行数:30,


示例14: GetPrivateProfileStringW

BOOL CDlgBatteryParam::OnInitDialog() {	CDialog::OnInitDialog();    m_batteryCell = -1;    GetPrivateProfileStringW(_T("Prompt"),_T("MESSAGE_TITLE"),_T("MESSAGE_TITLE"),        m_strMsgBoxTitle.GetBuffer(MAX_LENGTH),MAX_LENGTH, g_strLanguageConfigFilePath);	int n;	LPWSTR lpDir;	CString strTempPath;	CString strSystemPath;	lpDir=GetRootDir();	strSystemPath = (CString)lpDir;	if(lpDir)	{		delete lpDir;	}	n = strSystemPath.ReverseFind('//');    strTempPath = strSystemPath.Left(n);    n = strTempPath.ReverseFind('//');    strRootPath=strTempPath.Left(n);	strResourceDtsPath= strRootPath+_T("//dts//Resource.dts");	strResourceDtbPath= strRootPath+_T("//dts//rk-kernel.dtb");	strResourcePath=strTempPath+"//Android//Image//resource.img";    InitUIComponents();    //ReadBatteryParameters();		return TRUE;  // return TRUE unless you set the focus to a control	              // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:lidongqiang,项目名称:FWFactoryTool,代码行数:34,


示例15: bCheckIfDualBootingWithWin31

BOOL bCheckIfDualBootingWithWin31(){    WCHAR Buffer[32];    WCHAR awcWindowsDir[MAX_PATH];    DWORD dwRet;    UINT  cwchWinPath = GetWindowsDirectoryW(awcWindowsDir, MAX_PATH);// the cwchWinPath value does not include the terminating zero    if (awcWindowsDir[cwchWinPath - 1] == L'//')    {        cwchWinPath -= 1;    }    awcWindowsDir[cwchWinPath] = L'/0'; // make sure to zero terminated    lstrcatW(awcWindowsDir, L"//system32//");    lstrcatW(awcWindowsDir, WINNT_GUI_FILE_W);    dwRet = GetPrivateProfileStringW(                WINNT_DATA_W,                WINNT_D_WIN31UPGRADE_W,                WINNT_A_NO_W,                Buffer,                sizeof(Buffer)/sizeof(WCHAR),                awcWindowsDir                );    #if DBG    DbgPrint("/n dwRet = %ld, win31upgrade = %ws/n/n", dwRet, Buffer);    #endif    return (BOOL)(dwRet ? (!lstrcmpiW(Buffer,WINNT_A_YES)) : 0);}
开发者ID:Gaikokujin,项目名称:WinNT4,代码行数:33,


示例16: LoadItemString

wchar_t * LoadItemString(wchar_t * pItemID,wchar_t * pText,wchar_t * pDefault/* = NULL*/){		wchar_t * pLangFilePath = new wchar_t[1024];	memset(pLangFilePath,0,1024*sizeof(wchar_t));	GetCurrentDirectory(1024,pLangFilePath);	wcscat(pLangFilePath,L"//Language//");	wcscat(pLangFilePath,FFD.cFileName);	memset(pText,0,1024*sizeof(wchar_t));	if(GetPrivateProfileStringW(L"String",pItemID,L"",		pText,1024,pLangFilePath) != 0)	{		delete [] pLangFilePath;		return pText;	}	else	{		delete [] pLangFilePath;		if(pDefault)		{			return pDefault;		}		else		{			return L"";		}	}}
开发者ID:bodanrenko93,项目名称:hidedragon,代码行数:29,


示例17: read_appkey

BOOL read_appkey(LPCWSTR lpappname,              /* 区段名 */                 LPCWSTR lpkey,					 /* 键名  */                 LPWSTR  prefstring,			 /* 保存值缓冲区 */                 DWORD   bufsize				 /* 缓冲区大小 */                ){    DWORD  res = 0;    LPWSTR lpstring;    if ( profile_path[1] != L':' )    {        if (!ini_ready(profile_path,MAX_PATH))        {            return res;        }    }    lpstring = (LPWSTR)SYS_MALLOC(bufsize);    res = GetPrivateProfileStringW(lpappname, lpkey ,L"", lpstring, bufsize, profile_path);    if (res == 0 && GetLastError() != 0x0)    {        SYS_FREE(lpstring);        return FALSE;    }    wcsncpy(prefstring,lpstring,bufsize/sizeof(WCHAR)-1);    prefstring[res] = '/0';    SYS_FREE(lpstring);    return ( res>0 );}
开发者ID:Firef0x,项目名称:pcxfirefox,代码行数:27,


示例18: GetIniFloat2

float GetIniFloat2(wchar_t * lpAppName,wchar_t * lpKeyName,const wchar_t * lpFileName,const wchar_t * DefChar){	wchar_t ReadIniTMP[512];	float IniFloat=0.0f;	GetPrivateProfileStringW(lpAppName,lpKeyName,DefChar,ReadIniTMP,512,lpFileName);	swscanf_s(ReadIniTMP,L"%f",&IniFloat);	return IniFloat;}
开发者ID:SHIYUENING,项目名称:topace,代码行数:8,


示例19: GetPrivateProfileStringW

std::wstring LanguageSetting::GetLanguageW(TCHAR *key, TCHAR *name) {	TCHAR str[255];	GetPrivateProfileStringW(key, name, L"", str, 255, L".//lang.ini");	if (wcslen(str) == 0) {		swprintf(str, L"Error: No Language keyname /"%s/" in Key /"%s/".", key, name);	}	return replaceAll(std::wstring(str), L"//n", L"/n");}
开发者ID:kuna,项目名称:LR2Twit,代码行数:9,


示例20: GetPrivateProfileString

/*read the profile :fedExeNameChar;fomNameChar;fedNameChar*/void Hla::readIn( ){		TCHAR fedNameChar[256];	TCHAR userNameChar[256];	TCHAR fedExeNameChar[256];	TCHAR fomNameChar[256];	TCHAR crcAddressChar[256];	TCHAR crcPortChar[256];	TCHAR syncPointChar[256];			GetPrivateProfileString(L"GENERAL", L"FEDEXENAME", L"NO TEXT", fedExeNameChar, 256, Path);	GetPrivateProfileString(L"GENERAL", L"FOMNAME", L"NO TEXT", fomNameChar, 256, Path);	GetPrivateProfileString(L"GENERAL", L"CRC", L"NO TEXT", crcAddressChar, 256, Path);	GetPrivateProfileString(L"GENERAL", L"CRC_PORT", L"NO TEXT", crcPortChar, 256, Path);	GetPrivateProfileStringW(L"pub", L"FedName", L"NO TEXT", fedNameChar, 256, Path);  //GetPrivateProfileStringW(L"sub", L"FedName", L"NO TEXT", fedNameChar, 256, Path);		if (L"NO TEXT" == fedExeNameChar)	{		wcout << L"配置文件错误" << endl;		wcout << L"联邦名称错误" << endl;		system("pause");	}	if (L"NO TEXT" == fomNameChar)	{		wcout << L"配置文件错误" << endl;		wcout << L"Fom表名称错误" << endl;		system("pause");	}	if (L"NO TEXT" == crcAddressChar)	{		wcout << L"配置文件错误" << endl;		wcout << L"crc地址错误" << endl;		system("pause");	}	if (L"NO TEXT" == crcPortChar)	{		wcout << L"配置文件错误" << endl;		wcout << L"crc端口错误" << endl;		system("pause");	}	if (L"NO TEXT" == fedNameChar)	{		wcout << L"配置文件错误" << endl;		wcout << L"fed名称错误" << endl;		system("pause");	}		fedExeName_ = fedExeNameChar;	fomName_    = fomNameChar;	crcAddress_ = crcAddressChar;	crcPort_    = crcPortChar;	fedName_    = fedNameChar;	}
开发者ID:yanbodiaoweng,项目名称:DDSHLA,代码行数:62,


示例21: GetPrivateProfileStringW

std::wstringPkyIniFileWrap::GetStringW( const wchar_t* pszSect, const wchar_t* pszKey,  std::wstring const& strDefault){	WCHAR szWork[1024];	GetPrivateProfileStringW( pszSect, pszKey, strDefault.c_str(),		szWork, _countof(szWork), 		m_strFileName.c_str() 	);	return std::wstring( szWork );}
开发者ID:jugemjugem,项目名称:libShootTheSpeed,代码行数:10,


示例22: Out

void CCommandObj::InitializationConfig(LPCWSTR lpConfigFileFullPath){	Out(Dbg,_T("Initialization Config Starting."));	m_ConfigCommon.usResourceServerPort = GetPrivateProfileIntW(L"System",L"ResourceServerPort",DEFAULT_CONFIG_SERVER_RESOURCE_PORT,lpConfigFileFullPath);	m_ConfigCommon.usCommandServerPort = GetPrivateProfileIntW(L"System",L"CommandServerPort",DEFAULT_CONFIG_SERVER_COMMAND_PORT,lpConfigFileFullPath);	m_ConfigCommon.dwRetrySleep = GetPrivateProfileIntW(L"Retry",L"RetrySleep",DEFAULT_CONFIG_RETRY_SLEEP,lpConfigFileFullPath);	m_ConfigCommon.dwRetryCount = GetPrivateProfileIntW(L"Retry",L"RetryCount",DEFAULT_CONFIG_RETRY_COUNT,lpConfigFileFullPath);	GetPrivateProfileStringW(L"System",L"ServerAddress",DEFAULT_CONFIG_SERVER_ADDRESS,m_ConfigCommon.szServerAddress,MAX_ADDRESS_STRING_LEN,lpConfigFileFullPath);	Runend(true,_T("Initialization Config Stoping."));}
开发者ID:killvxk,项目名称:WebbrowserLock,代码行数:10,


示例23: do_parse_theme

static void do_parse_theme(WCHAR *file){    static const WCHAR colorSect[] = {        'C','o','n','t','r','o','l',' ','P','a','n','e','l','//',        'C','o','l','o','r','s',0};    WCHAR keyName[MAX_PATH], keyNameValue[MAX_PATH];    WCHAR *keyNamePtr = NULL;    char *keyNameValueA = NULL;    int keyNameValueSize = 0;    int red = 0, green = 0, blue = 0;    COLORREF color;    WINE_TRACE("%s/n", wine_dbgstr_w(file));    GetPrivateProfileStringW(colorSect, NULL, NULL, keyName,                             MAX_PATH, file);    keyNamePtr = keyName;    while (*keyNamePtr!=0) {        GetPrivateProfileStringW(colorSect, keyNamePtr, NULL, keyNameValue,                                 MAX_PATH, file);        keyNameValueSize = WideCharToMultiByte(CP_ACP, 0, keyNameValue, -1,                                               keyNameValueA, 0, NULL, NULL);        keyNameValueA = HeapAlloc(GetProcessHeap(), 0, keyNameValueSize);        WideCharToMultiByte(CP_ACP, 0, keyNameValue, -1, keyNameValueA, keyNameValueSize, NULL, NULL);        WINE_TRACE("parsing key: %s with value: %s/n",                   wine_dbgstr_w(keyNamePtr), wine_dbgstr_w(keyNameValue));        sscanf(keyNameValueA, "%d %d %d", &red, &green, &blue);        color = RGB((BYTE)red, (BYTE)green, (BYTE)blue);        HeapFree(GetProcessHeap(), 0, keyNameValueA);        set_color_from_theme(keyNamePtr, color);        keyNamePtr+=lstrlenW(keyNamePtr);        keyNamePtr++;    }}
开发者ID:AlexSteel,项目名称:wine,代码行数:42,


示例24: SetListColumnText

static void SetListColumnText(HWND hwnd, int listID, int index, wchar_t * lpKey, wchar_t * lpDefault, wchar_t * lpFile){	LVCOLUMNW		lvc = {0};	wchar_t			szBuffer[256];	lvc.mask = LVCF_FMT | LVCF_TEXT | LVCF_SUBITEM | LVCF_WIDTH;	lvc.cchTextMax = 256;	lvc.pszText = szBuffer;	SendDlgItemMessageW(hwnd, listID, LVM_GETCOLUMNW, index, (LPARAM)&lvc);	GetPrivateProfileStringW(S_COLUMNS, lpKey, lpDefault, szBuffer, 256, lpFile);	SendDlgItemMessageW(hwnd, listID, LVM_SETCOLUMNW, index, (LPARAM)&lvc);}
开发者ID:mju-oss-13-a,项目名称:team5-NoteMaster,代码行数:11,


示例25: process_hook_section

static HRESULT process_hook_section(install_ctx_t *ctx, const WCHAR *sect_name){    WCHAR buf[2048], val[2*MAX_PATH];    const WCHAR *key;    DWORD len;    HRESULT hres;    static const WCHAR runW[] = {'r','u','n',0};    len = GetPrivateProfileStringW(sect_name, NULL, NULL, buf, sizeof(buf)/sizeof(*buf), ctx->install_file);    if(!len)        return S_OK;    for(key = buf; *key; key += strlenW(key)+1) {        if(!strcmpiW(key, runW)) {            WCHAR *cmd;            size_t size;            len = GetPrivateProfileStringW(sect_name, runW, NULL, val, sizeof(val)/sizeof(*val), ctx->install_file);            TRACE("Run %s/n", debugstr_w(val));            expand_command(ctx, val, NULL, &size);            cmd = heap_alloc(size*sizeof(WCHAR));            if(!cmd)                heap_free(cmd);            expand_command(ctx, val, cmd, &size);            hres = RunSetupCommandW(ctx->hwnd, cmd, NULL, ctx->tmp_dir, NULL, NULL, 0, NULL);            heap_free(cmd);            if(FAILED(hres))                return hres;        }else {            FIXME("Unsupported hook %s/n", debugstr_w(key));            return E_NOTIMPL;        }    }    return S_OK;}
开发者ID:Kelimion,项目名称:wine,代码行数:41,


示例26: ndisks_load

void ndisks_load() {    wchar_t tmp[SECTIONS_BUFFER_SIZE], sTmp[SECTIONS_BUFFER_SIZE], *pTmp, rTmp[SECTIONS_BUFFER_SIZE];    size_t i = 0, j = 0;    NDisk disk;    if(available_disks == NULL) {        return;    }    wcslcpy(tmp, my_dir, SECTIONS_BUFFER_SIZE);    wcscat_s(tmp, SECTIONS_BUFFER_SIZE, _config_file);    GetPrivateProfileSectionNamesW(sTmp, SECTIONS_BUFFER_SIZE, tmp);    for(i = 0; i < SECTIONS_BUFFER_SIZE; i++) {        if(sTmp[0] == '/0') {            break;        }        if(sTmp[i] == '/0') {            pTmp = sTmp + j;            if(!pTmp || wcscmp(pTmp, L"") == 0) {                continue;            }            j = i + 1;            memset(&disk, 0, sizeof(NDisk));            GetPrivateProfileStringW(pTmp, L"type", NULL, rTmp, SECTIONS_BUFFER_SIZE, tmp);            if(!rTmp || wcscmp(rTmp, L"") == 0) {                continue;            }            disk.type = _wcsdup(rTmp);            GetPrivateProfileStringW(pTmp, L"username", NULL, rTmp, SECTIONS_BUFFER_SIZE, tmp);            if(!rTmp || wcscmp(rTmp, L"") == 0) {                free(disk.type);                continue;            }            disk.username = _wcsdup(rTmp);            disk.nickname = _wcsdup(pTmp);            GetPrivateProfileStringW(pTmp, L"token", NULL, rTmp, SECTIONS_BUFFER_SIZE, tmp);            disk.token = _wcsdup(rTmp);            GetPrivateProfileStringW(pTmp, L"secret", NULL, rTmp, SECTIONS_BUFFER_SIZE, tmp);            disk.secret = _wcsdup(rTmp);            dict_set_element_s(available_disks, pTmp, &disk, sizeof(NDisk), ndisk_destroy_s);        }    }}
开发者ID:kerneltravel,项目名称:netdisk4tc,代码行数:41,


示例27: SHELL32_GetCustomFolderAttributeFromPath

/*************************************************************************** *  SHELL32_GetCustomFolderAttribute (internal function) * * Gets a value from the folder's desktop.ini file, if one exists. * * PARAMETERS *  pidl          [I] Folder containing the desktop.ini file. *  pwszHeading   [I] Heading in .ini file. *  pwszAttribute [I] Attribute in .ini file. *  pwszValue     [O] Buffer to store value into. *  cchValue      [I] Size in characters including NULL of buffer pointed to *                    by pwszValue. * *  RETURNS *    TRUE if returned non-NULL value. *    FALSE otherwise. */static inline BOOL SHELL32_GetCustomFolderAttributeFromPath(    LPWSTR pwszFolderPath, LPCWSTR pwszHeading, LPCWSTR pwszAttribute,    LPWSTR pwszValue, DWORD cchValue){    static const WCHAR wszDesktopIni[] =            {'d','e','s','k','t','o','p','.','i','n','i',0};    static const WCHAR wszDefault[] = {0};    PathAddBackslashW(pwszFolderPath);    PathAppendW(pwszFolderPath, wszDesktopIni);    return GetPrivateProfileStringW(pwszHeading, pwszAttribute, wszDefault,                                     pwszValue, cchValue, pwszFolderPath);}
开发者ID:DeltaYang,项目名称:wine,代码行数:30,


示例28: assert

DWORD CIniFile::GetValue(const wchar_t *const pwchSection,	const wchar_t *const pwchKeyWord,	wchar_t *const pwchValue,	const DWORD dwValueSize,	const wchar_t *const pwchDefaultValue/*=NULL*/){	assert(NULL != pwchSection);	assert(NULL != pwchKeyWord);	assert(NULL != pwchValue);	assert(dwValueSize > 0);	return GetPrivateProfileStringW(pwchSection, pwchKeyWord, pwchDefaultValue, pwchValue, dwValueSize, m_wchPath);}
开发者ID:musclecui,项目名称:Solution1,代码行数:13,



注:本文中的GetPrivateProfileStringW函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetProc函数代码示例
C++ GetPrivateProfileStringA函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。