Solved

Read ini file to show on SDI screen

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 60
repeatSeparator  java  challenge 13 57
wait notify demo infinite loop 3 110
java ^ examples 8 65
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

785 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