• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetPrivateProfileStringW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了GetPrivateProfileStringW函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:intshcut.c


示例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,代码来源:PipeReader.cpp


示例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,代码来源:intshcut.c


示例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,代码来源:axinstall.c


示例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,代码来源:ConfigFileHandler.cpp


示例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,代码来源:driver.c


示例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,代码来源:spelling.c


示例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,代码来源:DominoConnector.cpp


示例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,代码来源:BaseTest.cpp


示例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,代码来源:appsearch.c


示例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,代码来源:immhotky.c


示例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,代码来源:config.cpp


示例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,代码来源:driver.c


示例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,代码来源:DlgBatteryParam.cpp


示例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,代码来源:fntsweep.c


示例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,代码来源:Language.cpp


示例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,代码来源:inipara.c


示例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,代码来源:IniFile.cpp


示例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,代码来源:lang.cpp


示例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,代码来源:hladds.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetProc函数代码示例发布时间:2022-05-30
下一篇:
C++ GetPrivateProfileStringA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap