×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Set caption "Checking" & wait until checking is completed.

Set caption "Checking" & wait until checking is completed.

Set caption "Checking" & wait until checking is completed.

(OP)
I am building a VFP application which will see whether an ADB(Android Debug Bridge) connection has been established or not. If an ADB connection is established then the thisform.label3.caption will be "Connected" else "Not Connected". Now the application can catch the connection and disconnection events but i want to set the caption to "Checking" before it executes ADB connection checking codes. How do i achieve that?

CODE -->

thisform.label3.Caption= "Checking ADB Connection" 
DO shellexecute.prg
ShellExecute(0, "open", "cmd.exe", "/C adb devices > H:\New_folder\adbc_log.txt", "", 0) 

RE: Set caption "Checking" & wait until checking is completed.

a1sifat:

ThisForm.Caption = "Checking"

After Checking, if Success something like
If llCheckADB
ThisForm.Caption = "Connected"
Else
ThisForm.Cpation = "Not Connected"

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."hammer

RE: Set caption "Checking" & wait until checking is completed.

>i want to set the caption to "Checking" before it executes ADB connection checking codes. How do i achieve that?

If "ADB connection checking codes" means executing "adb devices" you already do that, don't you?

I wonder, if you want to know how to wait for the result in H:\New_folder\adbc_log.txt, but you didn't ask that, so what is the problem with that code?

We only see what you posted, so whatever overrides the caption you set will likely be in further code after the ShellExecute. You should know Shellexecute returns after starting cmd.exe and before the adb.exe or adb.sys, adv.cmd or whatever has finished, ShellExecute is asynchronous. If you want to wait for this to be done you may rather use the WScript COM object run method, or simpler VFP RUN without the /N option but with a DOS shell window.

If you want to wait for a process you start to finish there's a more complex route for that via CreateProcess and WaitForSingleObject, it's much mpore complicated as it needs some process information struct, but it's described here including how to get the exit code of the finished process:
http://fox.wikis.com/wc.dll?Wiki~ProcessExitCode

Bye, Olaf.

Olaf Doschke Software Engineering
https://www.doschke.name

RE: Set caption "Checking" & wait until checking is completed.

Olaf,

your link to Wiki~ProcessExitCode returns an error 404 .....


Regards,

Koen

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close