LS,
I'm trying to create a windows service that calls a function in a
module. This is the code I use to call the function.
Protected Overrides Sub OnStart(ByVal args() As String)
' ' Add code here to start your service. This method
should set things
' ' in motion so your service can do its work.
Call Set_settings.Set_Constants()
End Sub
In the fucntion I want to connect to the active SolidWorks session.
This is how I do it.
Module Set_settings
Dim SwApp As SldWorks.SldWorks '# this can also be 'Dim SwApp As
Object'
Public Function Set_Constants_default()
SwApp = CreateObject("Sldworks.application", )
SwApp.Visible = True
End function
End module
When running the service, it cannot connect to SolidWorks. In the
background you can see that the application is being started (if it's
not already running), but then it times out and stops the application.
Can anybody help me with this one??
Kind regards,
JJ