Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6 code for switching forms

Status
Not open for further replies.

CatCox

Technical User
Dec 21, 2005
18
GB
I am trying to create a program whereby it uses two forms that act as servers. How can I code if one server fails another server should automatically take control. I'm not sure but can this be done using an array?
many thanks for any replies
 
Say what? I think an example of what you are trying to accomplish or more explanation is needed.


Andy Baldwin

"Testing is the most overlooked programming language on the books!"

Ask a great question, get a great answer. Ask a vague question, get a vague answer.
Find out how to get great answers FAQ219-2884.
 
How does a form act as a server?

Do you mean you call public methods to an instance of a form?

By "fail", do you mean there is an error? I think what you want is to add error handling. If there's a flaw in the form's code that causes an error, there's really not much sense in trying to create a new instance of the form to replace the original, as the new one will just get the same error.

 
Sorry for not explaining better, this program is just a simple number game where forms act as clients and a server. What I mean by server, this responds to client inputs. I need to setup a 2nd form using the winsock control. I need to code if form1(server1) should fail, then form2(server2) can take over. This is just a prototype in the event of failure.
 
Well, set up an error handler in your client, such that if the current form (form1) raises an error (i. e. fails), then use the second form.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top