Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

VB6 and WinPE

- - - - -

  • Please log in to reply
No replies to this topic

#1
mcslemon

mcslemon

    Newbie

  • Member
  • 42 posts
Hello :)

I've put together a VB6 application that controls my workstation imaging using ImageX. I currently have a app written in AutoIT that control it but it's fiddly to update. One of the things the AutoIT script does is reads the output of ImageX so I can increment a progress bar. I'd like to be able to do the same in VB6 and have managed it to a point, in so far as I can read the output if there is an error (which was intentional so I could check that it worked!).

I found a piece of code called GetCommandOutput (written by Joacim Andersson) which I use to read the output. I run into problems when I try and run ImageX with a valid image so it will progress. Rather than incrementing my progress bar, it hangs the form because (I'm assuming) it doesn't reach the portion of the code where it does this task.

Looking at the code I found, Joacim suggests that in order to stop the form hanging, the GetCommandOutput class should be run as an ActiveX EXE asynchronously. Because there was no info on how to run an ActiveX app from a standard one (I've no experience in this) I found another article that explained. I followed the instructions and it worked in a STANDARD windows environment. When I ran the same app in WinPE (2.0) it complains that it can't create the ActiveX Object (Run-time error '429').

I've played around a bit to try and get this to work. One method was to create an OCX in VB6 as I figured that that might help as you can register the OCX using regsvr32. This got rid of the error but the form hung again (I'm assuming because the OCX would be properly embedded?).

So back to the ActiveX EXE.

Dim ProgLoad as commandoutput 
'calls the ActiveX

..

Set ProgLoad = New commandoutput

..
..

ix = ProgLoad.GetCommandOutput("imagex.exe /apply i:\xpprep0.wim 1 c:", true, false,false)
'GetCommandOutput is the function inside commandoutput

..

'Loop through the output array which breaks down the output so I can find the %'ge figure.

If you need to see the GetCommandOutput code then I'll paste it, but since it works in a standard environment then I didn't see the point.

But that's where I'm at. Regardless of what I do, the form hangs or I get a 429 error.

Basically if someone could help me to get the ActiveX EXE running from the Standard app in a WinPE environment so the form doesn't hang and I can see the output then I'd be happy.

Cheers people. :)


How to remove advertisement from MSFN



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN