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. WPF
  4. GetPrivateProfileString does not work in WPF

GetPrivateProfileString does not work in WPF

Scheduled Pinned Locked Moved WPF
csharpsharepointwpftestingjson
4 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.
  • C Offline
    C Offline
    CooperWu
    wrote on last edited by
    #1

    I wrapped a class to call win32 api functions, use GetPrivateProfileString to get values in ini file. it works in Unit Test, but does not work called in WPF window. My project based on .NET FW 3.0, without any SP. anyone know how to solve this?

    Glad to discuss with you and best wishes.

    P 1 Reply Last reply
    0
    • C CooperWu

      I wrapped a class to call win32 api functions, use GetPrivateProfileString to get values in ini file. it works in Unit Test, but does not work called in WPF window. My project based on .NET FW 3.0, without any SP. anyone know how to solve this?

      Glad to discuss with you and best wishes.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      If it works in a unit test, there's no reason it shouldn't work in WPF. I wouldn't use this API though, if I were you, because it's designed to provided compatibility with 16 bit applications. You should look to use either the registry or a config file for your settings.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      My blog | My articles | MoXAML PowerToys

      C 1 Reply Last reply
      0
      • P Pete OHanlon

        If it works in a unit test, there's no reason it shouldn't work in WPF. I wouldn't use this API though, if I were you, because it's designed to provided compatibility with 16 bit applications. You should look to use either the registry or a config file for your settings.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        My blog | My articles | MoXAML PowerToys

        C Offline
        C Offline
        CooperWu
        wrote on last edited by
        #3

        Pete O'Hanlon wrote:

        If it works in a unit test, there's no reason it shouldn't work in WPF.

        Agree with you, but it true, it happened.

        Pete O'Hanlon wrote:

        You should look to use either the registry or a config file for your settings.

        I intend to write my classes to read\write ini file. I prefer to ini files than xml file as config file.

        Glad to discuss with you and best wishes.

        P 1 Reply Last reply
        0
        • C CooperWu

          Pete O'Hanlon wrote:

          If it works in a unit test, there's no reason it shouldn't work in WPF.

          Agree with you, but it true, it happened.

          Pete O'Hanlon wrote:

          You should look to use either the registry or a config file for your settings.

          I intend to write my classes to read\write ini file. I prefer to ini files than xml file as config file.

          Glad to discuss with you and best wishes.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Without seeing your project, there's not a lot I can suggest.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          My blog | My articles | MoXAML PowerToys

          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