Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact
A1VBCode Forums
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      

Home » .NET Programming » Visual Basic .NET/2005/2008 » How to make an API call, wait for it to...


How to make an API call, wait for it to...Expand / Collapse
Author
Message
Posted 10/9/2008 12:31:42 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/30/2008 10:50:41 AM
Posts: 1, Visits: 7
Hi all,

First time posting so be gentle!

I have a form with a button and when the user clicks the button it calls an external API function, which opens another form which requires user input. I want to close my form, but if I try to close it straight away, it closes the external form too before the user has had a chance to input the relevant details. Therefore I need a way to wait for that process to finish, before carrying on executing the rest of my code (to close my form).

I found the System.Diagnostics.Process class (with WaitForExit) but it seems to only work with external programs, not API calls.

There must be a really simple way of doing it but I'm just missing it.

Thanks,

Dan

 

Post #25945
Posted 10/9/2008 3:08:48 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 11/10/2008 10:28:14 AM
Posts: 13, Visits: 10
this typically depends on the API call, since it appears it runs on its own thread and passes back control to you immediately, you would be looking for a .join method or wait for finish method exposed by that api. i don't know of another way. Alternatively if there is a ShowDialog instead of just Show exposed, that would do the trick also.

Vb.net 2005, Teradata, Sql Server 2005, mainframe automation
Post #25948
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Brian, Peter

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 6:54am