Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help reading from INI file in Visual C++ 6.0

Posted on 2009-06-29
3
Medium Priority
?
1,630 Views
Last Modified: 2013-12-14
How do I read from an INI file in Visual C++ 6.0?  I have experience with GetPrivateProfileString in VB 6.0, but not sure on what to do in C++.  I assume I have to define the API appropriately, then I can simply call it just as I do in VB.

Any help would be very much appreciated.  I will also search the knowledgebase.

Thanks,

Todd Doucet
None yet.  This is for an existing DLL that is fairly sophistocated; however, it has no facility built into it to read from an INI file.  I would suggest reading from an XML file, but I don't know if that is possible with Visual C++ 6.0.  I can read a line from a file with the existing code, so if I have to, I will modify that code to read the lines in and then parse out the value I need.  It would be so much easier with the code to read values directly from an INI file, though.

Open in new window

0
Comment
Question by:tad0jazz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:tad0jazz
ID: 24740573
I looked in the Knowledgebase and it appears that "09/16/99 04:16 PM, ID: 10207256" will answer my question.  I will try the various code options that were suggested, but primarily the GetPrivateProfileString option, and I will update this question with the results once implemented.
If someone has a better suggestion, please feel free to respond.
Thanks,
tad0jazz
0
 
LVL 9

Accepted Solution

by:
Subrat (C++ windows/Linux) earned 200 total points
ID: 24742007
Yes need to use GetPrivateProfileString () and WritePrivateProfileString ().
http://msdn.microsoft.com/en-us/library/ms724353(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms725501(VS.85).aspx
U can use the example given there for ur understanding...
0
 

Author Closing Comment

by:tad0jazz
ID: 31598136
Thank you for replying.  You deserve the points for your effort, although I was able to locate similar information in the Knowledgebase.  Next time I will search the Knowledgebase first and only ask a question if I cannot locate an answer from a previous post.

Thanks again for replynig.

tad0jazz

By the way, GetPrivateProfileString() worked as expected.
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

618 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