Results 1 to 6 of 6

Thread: invalid procedure call or argument?

  1. #1

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    invalid procedure call or argument?

    whenever i try to run a second instance of my App i get this error

    mycode is:
    VB Code:
    1. Let App.Title = App.Title & " V" & App.Major & "." & App.Minor & "." & App.Revision
    2.     Let Caption = App.Title
    3.    
    4.     If App.PrevInstance Then
    5.         Call AppActivate(App.Title)
    6.         Call Unload(Me)
    7.         Exit Sub
    8.     End If

  2. #2

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: invalid procedure call or argument?

    its the appactive function nyone kno whats wrong?

  3. #3
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Re: invalid procedure call or argument?

    Maybe it is because there are two programs with the same caption.
    Try to change your caption, so there will only be one program with the same caption.

    eg
    Code:
    App.Title = App.Title & " V" & App.Major & "." & App.Minor & "." & App.Revision
    Caption = App.Title
    
    If App.PrevInstance Then
        Me.Caption = "Closing.."
        Call AppActivate(App.Title)
        Call Unload(Me)
        Exit Sub
    End If
    Frans

  4. #4

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: invalid procedure call or argument?

    i cant get my previous app get focus can any help?

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926

    Re: invalid procedure call or argument?

    Are you sure that your previous application has the same windowcaption as the argument you pass to AppActivate?
    I noticed that AppActivate produces the 'invalid procedure call or argument' error when no window is found with that caption.
    Do you change the window's caption somewhere else in your code?
    Frans

  6. #6

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: invalid procedure call or argument?

    it dint give the error anymore it just doesnt give focus to my previous app

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