Results 1 to 4 of 4

Thread: SetFocus Error in Windows XP

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Omaha, NE
    Posts
    18

    SetFocus Error in Windows XP

    Has anyone else ran into problems with Windows XP throwing error 5 (Invalid procedure call or argument) when running a VB6 app in Windows XP. One of my programs is occasionally throwing that error. But it only happens on Win XP machines and it is not consistent in throwing it.
    On another site a guy was talking about this like it was an acknowledged problem, but I didn't find anything about it in Microsoft's Knowledge Base. Does any one here know anything about it?

  2. #2
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Try:-
    VB Code:
    1. Public Sub SafeSetFocus(Byval ctlIn As Control)
    2.  
    3. If ctlIn.Visible And ctlIn.Enabled Then
    4.     ctlIn.SetFocus
    5. End If
    6.  
    7. End Sub
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Omaha, NE
    Posts
    18
    The control is visible and enabled. The error has never occurred outside of Windows XP. It does not occur on every setfocus in the program when run under XP. It's almost like a random (and changing) number of calls to setfocus causes the error.

  4. #4
    Lively Member
    Join Date
    May 2002
    Location
    Where you live
    Posts
    104
    I get this too, but differently: I get it when there are timers running when I bring up a Message Box.

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