Abstract:
A watched folder is monitored for XML files, once the event Created is
raised, an Indesign.Application should be created
And should process the XML, this works fine using a windows form
application.
Putting this in a Windows Service gives errors.
Description:
Error using a VB.NET Windows Service and the Indesign COM-object
Error:
>Compilation Windows Service
Result: Build OK
>InstallUtil dropMonitor.exe
Result: Service does not respond
Debug information:
"An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred in dropmonitor.exe"
"Additional information: COM-object with CLSID
{296CAEB5-C99C-4B3E-9359-6E7D6EAE71FC} is invalid or not registered"
Relevant code:
[dropMonitor.vb] = ServiceProcess
Imports System.ServiceProcess, System.IO, InDesign
Public Class dropMonitor
Inherits System.ServiceProcess.ServiceBase
...
'Required by the Component Designer
Private components As System.ComponentModel.IContainer
' NOTE: The following procedure is required by the Component Designer
' It can be modified using the Component Designer.
' Do not modify it using the code editor.
Friend WithEvents FileSystemWatcher1 As System.IO.FileSystemWatcher
' Added component
Friend myDocument As Debugged.Document
...
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e As
System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
Me.myDocument.XMLFilePath = e.FullPath
Me.myDocument.Generate()
Me.myDocument = Nothing
End Sub
[ProjectInstaller.vb] = ProjectInstaller
<RunInstaller(True)> Public Class ProjectInstaller
...
Friend WithEvents ServiceProcessInstaller1 As
System.ServiceProcess.ServiceProcessInstaller
Friend WithEvents ServiceInstaller1 As
System.ServiceProcess.ServiceInstaller
...
[Debugged.vb] = Own namespace
Imports System.IO, System.Collections, System.Xml, System.Threading,
InDesign
Namespace Debugged
Class Document
Private myDocument as Indesign.Application
Public Sub New()
If Me.myIndesign Is Nothing Then
Me.myIndesign = New InDesign.Application
End If
End Sub
End Class
End Namespace
Please help me, i'm |<-->| this close in getting it to work and the deadline
is yesterday!
Thank you in advance!
Frederik
Chee Pin Cheam - 18 Mar 2005 17:03 GMT
> Abstract:
> A watched folder is monitored for XML files, once the event Created is
[quoted text clipped - 78 lines]
>
> Frederik
It sounds like the Indesign COM component is not registered on the box
the you are using though. Is Indesign COM component registered?
Chee Pin
Willy Denoyette [MVP] - 27 Mar 2005 21:02 GMT
> Abstract:
> A watched folder is monitored for XML files, once the event Created is
> raised, an Indesign.Application should be created
> And should process the XML, this works fine using a windows form
> application.
> Putting this in a Windows Service gives errors.
Check your COM server access privileges using DCOMCNFG.EXE , make sure the
Services identity has access and execute privs enabled.
Willy.