Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GetProfileInt

GetProfileInt

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Try
    wrote on last edited by
    #1

    I created the .ini file manually in C:\ drive and added following [Section] a=1 b=2 CWinApp *pApp = AfxGetApp(); free((void*)pApp->m_pszProfileName); pApp->m_pszProfileName = _tcsdup("C:\\myfile.ini"); pApp->GetProfileInt("Section", "a", 0); But GetProfileInt() returns 0 instead of 1. I went through the registry. There was NO entry of ini section and entry, since i have created ini file manually. Whether GetProfileInt reads only registry or both registry and ini file?

    CPalliniC 1 Reply Last reply
    0
    • T Try

      I created the .ini file manually in C:\ drive and added following [Section] a=1 b=2 CWinApp *pApp = AfxGetApp(); free((void*)pApp->m_pszProfileName); pApp->m_pszProfileName = _tcsdup("C:\\myfile.ini"); pApp->GetProfileInt("Section", "a", 0); But GetProfileInt() returns 0 instead of 1. I went through the registry. There was NO entry of ini section and entry, since i have created ini file manually. Whether GetProfileInt reads only registry or both registry and ini file?

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      You should use GetPrivateProfileInt [^].

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

      In testa che avete, signor di Ceprano?

      T 1 Reply Last reply
      0
      • CPalliniC CPallini

        You should use GetPrivateProfileInt [^].

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

        T Offline
        T Offline
        Try
        wrote on last edited by
        #3

        Thank you..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups