GetPrivateProfileString blank string

Posted on 2006-05-18
Medium Priority
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

wayside earned 1000 total points
ID: 16709679
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.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

840 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