Solved

Read ini file to show on SDI screen

Posted on 2004-10-11
4
203 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 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

18 Experts available now in Live!

Get 1:1 Help Now