RobSchultz
Programmer
Apologies, In the hopes that this question got lost in all the activity of this site I'm re-posting it.
Hello all,
I'm trying to create an add-in that does the following...
1. Stops IIS web services
2. Recompiles the project
3. Restarts IIS web services
This is all in the hope of making my life easier while testing Web COM objects. My problem is that the MakeCompileFile method always returns the error 80004005. There is almost no information about MakeCompileFile to be found anywhere. It looks like I'm using the method correctly but it just doesn't work. The code is below. Form is 2 buttons (btnExit, btnRecompile) and 2 labels (lblProject, lblStatus). I could use the command line /make but it requires that the project not be open. I'm not fixated on using any one method so any other ideas/help will be greatly appreciated...
BTW - Win2K SP1 with VB6 SP4
Thanks, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
Hello all,
I'm trying to create an add-in that does the following...
1. Stops IIS web services
2. Recompiles the project
3. Restarts IIS web services
This is all in the hope of making my life easier while testing Web COM objects. My problem is that the MakeCompileFile method always returns the error 80004005. There is almost no information about MakeCompileFile to be found anywhere. It looks like I'm using the method correctly but it just doesn't work. The code is below. Form is 2 buttons (btnExit, btnRecompile) and 2 labels (lblProject, lblStatus). I could use the command line /make but it requires that the project not be open. I'm not fixated on using any one method so any other ideas/help will be greatly appreciated...
Code:
Public VBInstance As VBIDE.VBE
Public Connect As Connect
Option Explicit
Private Sub btnExit_Click()
Connect.Hide
End Sub
Private Sub Form_Load()
lblProject = "Current Project: " & VBInstance.ActiveVBProject.Name
End Sub
Private Sub btnRecompile_Click()
On Error GoTo errHandler
Dim retVal As Variant
Dim oWSH As Object
Set oWSH = CreateObject("WScript.Shell")
Status ("Stopping web services...")
retVal = oWSH.Run("c:\winnt\system32\cmd.exe /c net stop ""IIS Admin Service"" /y", 7, True)
Status ("Web services stopped.")
Status ("Compiling project...")
VBInstance.ActiveVBProject.MakeCompiledFile
Status ("Project compiled.")
Status ("Starting web services...")
retVal = oWSH.Run("c:\winnt\system32\cmd.exe /c net start ""IIS Admin Service""", 7, True)
retVal = oWSH.Run("c:\winnt\system32\cmd.exe /c net start ""World Wide Web Publishing Service""", 7, True)
Status ("Web services started.")
Status ("Finished!")
Exit Sub
errHandler:
MsgBox "Error Desc: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error DLL: " & Err.LastDllError, , "ERROR!"
Connect.Hide
Unload Me
End Sub
Sub Status(msg As String)
lblStatus = "Current Operation: " & msg
End Sub
Thanks, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-