GetPrivateProfileString blank string

Posted on 2006-05-18
Last Modified: 2013-11-20
If in my INI file I have a key and value like this
//after the hello= is 5 blank spaces
The getprivateprofilestring isn't picking those up, it just comes back with an empty string, anyway to get around that?
Question by:cophi
    1 Comment
    LVL 14

    Accepted Solution

    From the MSDN page on GetPrivateProfileString:

    "The function inserts a null character in the lpReturnedString buffer to strip any trailing blanks."

    So there is no way to get around this using GetPrivateProfileString.

    I think your only solution is to process the ini file yourself. There are plenty of classes around to do this, look around, you can probably find one.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now