如题,我用WritePrivateProfileString函数写入数据到文件。因为我的操作需要不停的写入和读出ini文件的内容,但是
WritePrivateProfileString函数是在关闭程序后才会写入到ini文件中的,有延时。求解!!!PS:fwrite函数有fflush函数配合可以立即写入,不知道对WritePrivateProfileString有没有相应的函数配合立即写入!

解决方案 »

  1.   

    Registry Functions
    The following functions are used with the registry:   
     
    RegCloseKey  
    RegConnectRegistry  
    RegCreateKey  
    RegCreateKeyEx  
    RegDeleteKey  
    RegDeleteValue  
    RegEnumKey  
    RegEnumKeyEx  
    RegEnumValue  
    RegFlushKey  
    RegGetKeySecurity  
    RegLoadKey  
    RegNotifyChangeKeyValue  
    RegOpenKey  
    RegOpenKeyEx  
    RegQueryInfoKey  
    RegQueryMultipleValues  
    RegQueryValue  
    RegQueryValueEx  
    RegReplaceKey  
    RegRestoreKey  
    RegSaveKey  
    RegSetKeySecurity  
    RegSetValue  
    RegSetValueEx  
    RegUnLoadKey  
    Obsolete Functions
      
     
    GetPrivateProfileInt  
    GetPrivateProfileSection  
    GetPrivateProfileSectionNames  
    GetPrivateProfileString  
    GetPrivateProfileStruct  
    GetProfileInt  
    GetProfileSection  
    GetProfileString  
    WritePrivateProfileSection  
    WritePrivateProfileString  
    WritePrivateProfileStruct  
    WriteProfileSection  
    WriteProfileString  
     
      

  2.   

    你就当这文件来写不行吗?这样不就有fflush了?
      

  3.   

    WritePrivateProfileString貌似没有你要的函数频繁调用就用CFile和StdioFile吧
      

  4.   

    GetPrivateProfileXXX/WritePrivateProfileXXX 系列就是即时写入的,没有什么关闭写入的说法。