Click here to Skip to main content
15,911,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow do i automatically scroll to the bottom of a edit control when text gets added? Pin
Redeemer-dk1-Dec-02 10:03
Redeemer-dk1-Dec-02 10:03 
AnswerRe: How do i automatically scroll to the bottom of a edit control when text gets added? Pin
Daniel Ferguson1-Dec-02 14:17
Daniel Ferguson1-Dec-02 14:17 
Generalfriend member function can't access private member var?? what's wrong Pin
ttzzgg_807131-Dec-02 8:29
ttzzgg_807131-Dec-02 8:29 
Generalerror C2248: 'm_idParent' : cannot access private member declared in class 'DownKind'------>this is the error infomation Pin
ttzzgg_807131-Dec-02 8:31
ttzzgg_807131-Dec-02 8:31 
GeneralRe: error C2248: 'm_idParent' : cannot access private member declared in class 'DownKind'------>this is the error infomation Pin
Christian Graus1-Dec-02 9:51
protectorChristian Graus1-Dec-02 9:51 
GeneralRe: friend member function can't access private member var?? what's wrong Pin
Christian Graus1-Dec-02 9:50
protectorChristian Graus1-Dec-02 9:50 
ttzzgg_80713 wrote:
don't laught at me.

I would hope that no-one would laugh at you, I've written far worse code than this, I promise you.

ttzzgg_80713 wrote:
ifs >> d.m_strKind >> endl >> d.m_strPath >> endl >>
d.m_strSuffix >> d.m_id >> d.m_idParent >> d.m_lstSub.size()
>> endl;


You should read my article on iostream inserters and extractors. There is a bit of stuff you should be doing and are not, but the main point here is that you keep using endl, which performs a flush as well as a newline. This is a big performance hit. Also, when I write stuff like this, I have no using statements, I always explcitly scope std:: for everything. The reason is, the code is designed to be included in other projects, and it's probable clients of this inserter will not look at the code, and will silently find stuff pulled into the global namespace. Yes, this is probably just for you ( or your teacher ), but it's good to establish good habits.


ttzzgg_80713 wrote:
private:

You need to make the operator a friend of this class, or provide get methods to get to the data. Again, my article on iostream inserters is the way to go.


Christian

No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002

Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002

Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
GeneralRe: friend member function can't access private member var?? what's wrong Pin
ttzzgg_807131-Dec-02 22:24
ttzzgg_807131-Dec-02 22:24 
GeneralQueue help Pin
ian_ok1-Dec-02 4:15
ian_ok1-Dec-02 4:15 
GeneralRe: Queue help Pin
Christian Graus1-Dec-02 12:56
protectorChristian Graus1-Dec-02 12:56 
GeneralRe: Queue help Pin
Dudi Avramov1-Dec-02 5:21
Dudi Avramov1-Dec-02 5:21 
GeneralRe: Queue help Pin
geo_m1-Dec-02 8:20
geo_m1-Dec-02 8:20 
GeneralRe: Queue help Pin
Christian Graus1-Dec-02 12:57
protectorChristian Graus1-Dec-02 12:57 
GeneralRe: Queue help Pin
geo_m1-Dec-02 13:24
geo_m1-Dec-02 13:24 
GeneralRe: Queue help Pin
Christian Graus1-Dec-02 13:28
protectorChristian Graus1-Dec-02 13:28 
GeneralRe: Queue help Pin
geo_m1-Dec-02 13:55
geo_m1-Dec-02 13:55 
GeneralRe: Queue help Pin
Christian Graus1-Dec-02 14:01
protectorChristian Graus1-Dec-02 14:01 
GeneralRe: Queue help Pin
ian_ok1-Dec-02 8:52
ian_ok1-Dec-02 8:52 
GeneralRe: Queue help Pin
Christian Graus1-Dec-02 12:59
protectorChristian Graus1-Dec-02 12:59 
GeneralRe: Queue help Pin
ian_ok2-Dec-02 3:29
ian_ok2-Dec-02 3:29 
GeneralRe: Queue help Pin
Gary R. Wheeler3-Dec-02 15:12
Gary R. Wheeler3-Dec-02 15:12 
GeneralLink errors with GDI+ Pin
Salvador Dali1-Dec-02 3:58
Salvador Dali1-Dec-02 3:58 
GeneralRe: Link errors with GDI+ Pin
Michael Dunn1-Dec-02 5:41
sitebuilderMichael Dunn1-Dec-02 5:41 
GeneralRe: Link errors with GDI+ Pin
Salvador Dali1-Dec-02 10:41
Salvador Dali1-Dec-02 10:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.