Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / March 2005

Tip: Looking for answers? Try searching our database.

Problem: Calling Indesign from a Windows Service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frederik - 18 Mar 2005 11:49 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.

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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.