Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:31:34+00:00 2026-06-01T20:31:34+00:00

My question is a little complicated: I am having Socket server, and I have

  • 0

My question is a little complicated:

I am having Socket server, and I have two forms. One is the main form for the server and the other one is a custom made messagebox. When a request comes to the server the main form has to invoke the second form (messagebox). When the main form is open for the first time everything works fine. But when I close the main form without closing the application and open it again and request comes to the server the custom made messagebox opens but it freezes and looks like this:

enter image description here

The Code for invoking:

Private Delegate Sub DInvoke(ByRef Frm As Form, ByVal Text As String, ByVal Title As String, ByVal Socket As Integer, ByVal DataX As String, ByVal ReqForProfil As Boolean)

Public Sub ShowMessage(ByRef Frm As Form, ByVal Text As String, ByVal Title As String, ByVal Socket As Integer, ByVal DataX As String, ByVal ReqForProfil As Boolean)
    If Frm.InvokeRequired Then
        Dim DT As New DInvoke(AddressOf ShowMessage)
        Frm.Invoke(DT, New Object() {Frm, Text, Title, Socket, DataX, ReqForProfil})
    Else
        Messegar = New MessageFrm(Text, Title, Socket, DataX, ReqForProfil, True, 30)
        Messegar.Show()
    End If
End Sub

Any help would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:31:36+00:00Added an answer on June 1, 2026 at 8:31 pm

    Debug it. Set a breakpoint on InvokeRequired. You know it should be true since the method is called from a I/O completion thread. The problem you describe is consistent with the property returning False. So the Invoke doesn’t happen and the form is created on the worker thread instead of the UI thread. Where it is dead as a doornail since that thread isn’t pumping a message loop.

    Which is invariably caused by passing a bad form object. Like “Form1”, a type instead of an object, a nasty VB.NET trap. Or passing “new Form1”, a new instance of the form object instead of the one that user is looking at.

    A Q&D fix is to pass Application.OpenForms(0) instead. A clean fix is to pass a valid form reference to the constructor of the class that works with the socket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A small - little question. I have seen many application having buttons like following.
My question is a little complicated so I'll start with an example: class a
I have little question about how web browser retrieve webpage? I know this User
I have little question. I found this on internet: Type t = typeof(MyClass); MethodInfo[]
I have a little question to community. Does ASP.NET MVC allow to execute an
I have this little question that's been on my mind for a while now.
i have a little question, regarding to slideup and slidedown, the problem is in
I have only a little question: Why the CFPreferences-API creates multiple files in my
I have a simple question related to one-line programming. First an example: function test(a)
My question is a little bit complicated. I want to understand how the app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.