vbinputbox pauses code while it waits on response. How can I reproduce that?

vb6 , class , forms Durham, United States
  • 12 years ago
    In my class I have a piece of code that works fine with the vbinputbox. I need to request username and password. Thing is it doesn't have but one textbox to enter in one value. So I thought I might implement a custom form that would allow me to enter in both username and password (in a class). Thing is when I do it that way it doesn't pause the code until user has finished entering information before it processes the next statement in code. Does anyone know of a method that would pause the code until it has received the user information? Example would be great. here is the part that validates username and password. If m_CreatorUserID = "" Then If strUsername = "" Then d_InputMessage = InputBox("Please enter your Lotus Notes ID:", "cXMLHttpMegabyte", "Lotus Notes ID...", 0, 0) If d_InputMessage = "" Then Err.Raise vbObjectError + 1100, "Source=cXMLHttpMegaByte.f_MegaByteAuthenticate", "You can not proceed without entering in your credentials." Exit Function Else m_CreatorUserID = d_InputMessage End If Else m_CreatorUserID = strUsername End If End If If m_CreatorPassword = "" Then If strPassword = "" Then d_InputMessage = InputBox("Please enter your Lotus Notes Password:", "cXMLHttpMegabyte", "Lotus Notes Password...", 0, 0) If d_InputMessage = "" Then Err.Raise vbObjectError + 1100, "Source=cXMLHttpMegaByte.f_MegaByteAuthenticate", "You can not proceed without entering in your credentials." Exit Function Else m_CreatorPassword = d_InputMessage End If Else m_CreatorPassword = strPassword End If End If
  • 12 years ago
    nevermind I figured it out using WaitForSingleObject API.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Anyone who considers arithmetic methods of producing random digits is, of course, in a state of sin.” - John von Neumann