+ Reply to Thread
Results 1 to 4 of 4

Thread: wucheck return value in VB6

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Location
    London
    Posts
    4

    Unhappy wucheck return value in VB6

    Hi,

    I can't seem to find an answer to this question anywhere...I'm using the shellexecute API to run wucheck from my VB6 program but I can't find a way to retrieve the return value that indicates whether there is a new version of my program available or not. The return value from shellexecute simply tells me whether it was able to run wucheck ok.

    Thanks for your help.

    Wole.

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: wucheck return value in VB6

    Wole,

    In Windows, if you use ShellExecuteEx, you have to "wait" for the launched application to retrieve the return value from that app. You have to use the WaitForSingleObject Windows API to wait and then GetExitCodeProcess to retrieve the exit code.

    BTW, this is not only for wupdate.exe or wucheck.exe. This is for all Windows applications.

    Does this help?

    Friedrich

  3. #3
    Join Date
    Sep 2010
    Location
    London
    Posts
    4

    Thumbs up Re: wucheck return value in VB6

    Hi Friedrich,

    All my research confirms what you said but not being the hottest Windows API programmer around, I chose to do the following instead:

    1. Write a short function on the webserver than hosts my updates. This opens the 'program updates manifest file', reads the version information and returns whatever it finds; it literally took just 5 minutes to write this!
    2. Call that webserver 'api' from my desktop application using code that I already have written and tested that does http GETs and POSTs. This gives me the version number available.
    3. Check it against the version number of the currently running application, and voila, my very own, homegrown wucheck .
    4. If the programme needs updating and the user chooses to do so, I then simply shellexecute wupdate.exe to do the 'heavy lifting' and exit my app.

    Works for me and was easier to implement due to having code already available to do most of it anyway.

    Thanks for your help. I just thought to document the route I took in case it helps anyone else.

    Regards,


    Wole.

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: wucheck return value in VB6

    Hello Wole,

    I have not written any VB code for more than 10 years now, so unfortunately, I do not have a good ShellExecute/Wait function for VB available.

    But the following link demonstrates how to use ShellExecuteEx and the "Wait" option:
    http://files.codes-sources.com/fichi...in.bas&lang=en

    Friedrich
    Attached Images Attached Images  

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •