Solved

Read ini file to show on SDI screen

Posted on 2004-10-11
4
204 Views
Last Modified: 2013-11-20
I'm a newbie to VC++ and I'm having a problem with reading ini file then show it on SDI screen.
The ini file is divided into sections which I call "Slide". I want to read these Slides and then show each Slide on the SDI screen. Slides will follow each other with a left mouse click, means that after I select the file from the Open File dialog, the first Slide of the file will show up on the SDI, then I click on the left mouse button, the second Slide will show up to replace the first Slide and so on...
I read the file OK, but having problem to show each Slide after left mouse click.
I think I must use OnDraw and Invalidate() but I still don't know how to use them.

I will really appreciate the sample code with comments for my problem
Thanks

The sample ini file :

[Slide 1]
text1=This is the 1st line
text2=This is the 2nd line
text3=This is the 3rd line

[Slide 2]
text1=This is the 1st line
text2=This is the 2nd line
text3=This is the 3rd line
text4=This is the 4th line

[Slide 3]
text1=This is the 1st line

0
Comment
Question by:huy302
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Amritpal Singh
ID: 12284168
is ur problem with reading files or with displaying them
0
 
LVL 6

Accepted Solution

by:
Amritpal Singh earned 100 total points
ID: 12284183
ok sorry ,i didn't read it properly
ur problem is with displaying them
u can use OnLButtonDown event

have ur slides saved in a string array

and each time OnLButtonDown event is triggered display the string at next position
 u can use  a global or static counter fro this
0
 
LVL 13

Expert Comment

by:SteH
ID: 12285658
You are partly right,
in OnDraw you display the current slide which can reside in a CString or CStringArray.

In OnLButtonDown you change the content of the string to be displayed with the text of the next slide. And next you invalidate the view. That way it gets repainted which implicitly calls OnDraw (). No need to call it on your side.
0
 

Author Comment

by:huy302
ID: 12296448
you was right, amrit 82, my problem was that I read the file, saved my strings in one class and then triggered the OnDraw() function in another class so I can't have my strings to display.
Using global variable I can solve this problem well
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 87
sameEnds challenge 3 133
FizzBuzz challenge 9 76
JQuery serialize and unserialize 8 48
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

929 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

15 Experts available now in Live!

Get 1:1 Help Now