BOOL WritePrivateProfileString(
LPCTSTR lpAppName,
LPCTSTR lpKeyName,
LPCTSTR lpString,
LPCTSTR lpFileName
);
请问这个函数怎么调用??????????

解决方案 »

  1.   

    The WritePrivateProfileString function copies a string into the specified section of an initialization file. Note  This function is provided only for compatibility with 16-bit versions of Windows. Applications should store initialization information in the registry. BOOL WritePrivateProfileString(
      LPCTSTR lpAppName,  // section name
      LPCTSTR lpKeyName,  // key name
      LPCTSTR lpString,   // string to add
      LPCTSTR lpFileName  // initialization file
    );
    Parameters
    lpAppName 
    [in] Pointer to a null-terminated string containing the name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case-independent; the string can be any combination of uppercase and lowercase letters. 
    lpKeyName 
    [in] Pointer to the null-terminated string containing the name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries within the section, is deleted. 
    lpString 
    [in] Pointer to a null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted. 
    Windows 95/98/Me: The system does not support the use of the TAB (\t) character as part of this parameter. lpFileName 
    [in] Pointer to a null-terminated string that specifies the name of the initialization file. 
      

  2.   

    直接调用啊。比如一个当前目录下的config子目录下的a.ini文件的内容是:
    [Options]
    name=value
    .
    .
    .
    你可以这样吧name改掉:
    WritePrivateProfileString("Options", "name", "new value", ".\\cofnig\、a.ini");
      

  3.   

    WritePrivateProfileString("Options", "name", "new value", ".\\cofnig\\a.ini");
      

  4.   

    如xml.ini文件有以下选项
    [help]
    key=2lpAppName是xml.ini文件中的help名称。
    lpKeyName是xml.ini文件中help区key名
    lpString是你要写的值.如2
    lpFileName是文件名.如xml.ini