Results 1 to 7 of 7

Thread: Out of Stack space error sending list1 text to list2 text.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    101

    Out of Stack space error sending list1 text to list2 text.

    I seem to be running into a problem perhaps I should explain a little what im trying to do so I wont need to keep on making all theses topics.


    Im trying to use Text1.Text to add to the list of names that are in List1 then I send all the names in list1 to list2 however im getting a Out of Stack space error

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Out of Stack space error sending list1 text to list2 text.

    Without seeing your routine, we can't help much. That error generally means you have entered an infinite loop.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    101

    Re: Out of Stack space error sending list1 text to list2 text.

    let me see if I can clean up my form abit and I'll post what I got.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    101

    Re: Out of Stack space error sending list1 text to list2 text.

    Code:
    Private Sub Command1_Click()
    Dim imclass As Long
    Dim yiminputwindow As Long
    Dim x As Long, editx As Long
    Dim Button As Long
    
    On Error Resume Next
    imclass = FindWindow("imclass", vbNullString)
    PostMessage imclass, WM_COMMAND, 33134, 0
    
    DoEvents
    x = FindWindow("#32770", vbNullString)
    editx = FindWindowEx(x, 0&, "Edit", vbNullString)
    
    
    DoEvents
    x = FindWindow("#32770", vbNullString)
    Button = FindWindowEx(x, 0&, "button", "&Ignore User...")
    Call SendMessageLong(Button, WM_KEYDOWN, VK_SPACE, 0&)
    Call SendMessageLong(Button, WM_KEYUP, VK_SPACE, 0&)
    
    Do
        DoEvents
        imclass = FindWindow("imclass", vbNullString)
        yiminputwindow = FindWindowEx(imclass, 0&, "yiminputwindow", vbNullString)
        Call SendMessageByString(yiminputwindow, WM_SETTEXT, 0&, List2.Text & " have been Ignored.")
    Call SendMessageLong(yiminputwindow, WM_KEYDOWN, 13, 0&)
    Loop Until yiminputwindow <> 0
    End Sub
    
    Private Sub Command2_Click()
    cd1.FileName = ""
        cd1.Filter = "Namelist (*.txt)|*.txt"
        cd1.ShowSave
        If cd1.FileName <> "" Then
            Savenublist cd1.FileName, List1
        End If
    End Sub
    
    Private Sub Command3_Click()
    Loadtxt cd1, List1
    End Sub
    
    Private Sub Command4_Click()
    Text1.Text = List1.Text
    End Sub
    Function Loadtxt(dialogCommon As CommonDialog, list45 As ListBox)
        
            With dialogCommon
                .DialogTitle = "Load Your Yahoo! Lamer List"
                .Filter = "Lamers Namelist (*.txt)|*.txt"
                .ShowOpen
                            Close #1
                Open .FileName For Input As #1
               While Not EOF(1)
            
                Line Input #1, allstring
                List1.AddItem allstring
                Wend
                Close #1
                
            
            End With
    
    End Function
    Function Savenublist(thefilename As String, thelist As ListBox)
    Open thefilename For Output As #1
    For i = 0 To List1.ListCount - 1
    Print #1, List1.List(i)
    Next i
    Close #1
    End Function
    
    Private Sub Form_Load()
    
    End Sub
    
    Private Sub List1_Click()
    List1.Text = List2.Text
    End Sub
    is what I have Im basicly making a program to ignore a list of names within a list box and then display the names that I have ignored within list2.

    The point of this program is for yahoo and this is my work around for syslistview heh, it basicly uses a list of names you can load and then save and use again later.

    Feel free if there is anything I should currect to this to that might be a problem.

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Out of Stack space error sending list1 text to list2 text.

    Hmmmm.
    You are looking for windows but not checking if the return value is zero. Do that. If zero, then the window was not found & you should abort your routine.

    Recommend not hardcoding file numbers, use VB's FreeFile() function to return one for you.

    Your problem is the List1.Text=List2.Text. Each time you set a listbox item from code, it fires another Click event. Since you are setting it in the click event, you are entering an infinite loop until stack space or memory prevents it from going on and on and on and ....
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Feb 2008
    Posts
    101

    Re: Out of Stack space error sending list1 text to list2 text.

    I dont think I follow is it possible to show me what your talking about maybe give me something to work with? Im not a genus with Visual Basic

  7. #7
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Out of Stack space error sending list1 text to list2 text.

    Quote Originally Posted by BlackMagic
    I dont think I follow is it possible to show me what your talking about maybe give me something to work with? Im not a genus with Visual Basic
    Yes, remove or fix this part:
    Code:
    Private Sub List1_Click()
    List1.Text = List2.Text
    End Sub
    I doubt you want to click on a list1 item, then assign it to a list2 item. I think you might want the reverse action. It is not clear what your intentions are. Also, recommend not getting in the habit of assigning a listbox value by some .Text value. If the text doesn't exist in the listbox, then errors.

    You have several posts that a very similar. Consider marking ones resolved that do not require any more feedback, so no one wastes their time answering questions that do not need to be answered. Thank you.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Posting Permissions

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



Click Here to Expand Forum to Full Width