String passing between functions in VC++ SDI application - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18

Thread: String passing between functions in VC++ SDI application

  1. #16
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,300

    Re: String passing between functions in VC++ SDI application

    Define "not working".
    1. What does
      Code:
      	int nItem = ctlRightView.GetItemCount();
      return?
    2. What does
      Code:
      	int index = ctlRightView.InsertItem(nItem,  league);
      return?
    3. Why do you every time insert the column 1? Where and how did you insert the column 0?
    Victor Nijegorodov

  2. #17
    Join Date
    Mar 2013
    Posts
    9

    Re: String passing between functions in VC++ SDI application

    During the first call of Display()
    Code:
    int nItem = ctlRightView.GetItemCount();
    this one returns 0

    Code:
    int index = ctlRightView.InsertItem(nItem,  league);
    this also return 0
    Output is
    First(column name)
    brother
    ..................................................
    and the when the second tokenozed opens comes it again calls Display()
    both the above code returns 0 only. i see only
    First(column name)
    man

    but not

    First(column name)
    man
    brother
    -----------------------------------------
    Answer for ur 3rd ques: Like i call insertcolumn in index 0 only how do i stop thatInsertColumn() function call alone while second time this Display() is called??
    Last edited by maxer; April 17th, 2013 at 02:21 AM.

  3. #18
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,300

    Re: String passing between functions in VC++ SDI application

    Quote Originally Posted by maxer View Post
    During the first call of Display()
    Code:
    int nItem = ctlRightView.GetItemCount();
    this one returns 0

    Code:
    int index = ctlRightView.InsertItem(nItem,  league);
    this also return 0
    Output is
    First(column name)
    brother
    Good! It is correct and as expected.

    Quote Originally Posted by maxer View Post
    and the when the second tokenozed opens comes it again calls Display()
    both the above code returns 0 only. i see only
    First(column name)
    man

    but not

    First(column name)
    man
    brother
    Well, if GetItemCount() returns zero than either you have deleted the item before this call or you "occasionally" created another list control


    Quote Originally Posted by maxer View Post
    Answer for ur 3rd ques: Like i call insertcolumn in index 0 only how do i stop thatInsertColumn() function call alone while second time this Display() is called??
    But why do you insert new column every time you are going to insert a new item? Why not to do it once somewhere in OnInitialUpdate()?
    Victor Nijegorodov

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center