Groups | Blog | Home
all groups > dotnet interop > march 2005 >

dotnet interop : Problem: Calling Indesign from a Windows Service



Frederik
3/18/2005 11:52:26 AM
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:
[quoted text, click to view]
Result: Build OK

[quoted text, click to view]
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
3/19/2005 12:03:41 AM
[quoted text, click to view]
It sounds like the Indesign COM component is not registered on the box
the you are using though. Is Indesign COM component registered?

Willy Denoyette [MVP]
3/27/2005 10:02:00 PM

[quoted text, click to view]

Check your COM server access privileges using DCOMCNFG.EXE , make sure the
Services identity has access and execute privs enabled.

Willy.

AddThis Social Bookmark Button