cancel
Showing results for 
Search instead for 
Did you mean: 

DLL for NX-Remote fails to load at startup

Genius
Genius

Hi,

 

I'm writing a program to execute code in NX9 by remoting.

There is a nice example that work very well when you execute the DLL manually (ctrl+U):

http://community.plm.automation.siemens.com/t5/NX-Programming-Customization/Open-part-Issue-during-N...

 

But when i try to load automatically when NX start then the DLL will not load.

steps:

  • set UGII_USER_DIR=c:\11111111\UGII_USER_DIR\
  • copy the dll to %UGII_USER_DIR%\startup
  • start NX

The code contains:

 'manual load by ctrl+U
    Public Shared Sub Main(args As [String]())
        Start()
    End Sub

 'automatic load at startup
    Public Shared Sub Start()
        Dim serverThread As New Thread(New ThreadStart(AddressOf Run))
        serverThread.Start()
    End Sub

    Public Shared Sub Run()

***** my code here  *****

   End Sub

NX9 SYSLOG

Trying to load C:\PLM\NX9\ugii\managed\ManagedLoader.dll
ManagedLoader.Load: c:\11111111\UGII_USER_DIR\startup\SG_NX_Remote_Server.dll Name:SG_NX_Remote_Server.dll
There are no context policies.

AppBase: c:\11111111\UGII_USER_DIR\startup\
Loaded assembly: SG_NX_Remote_Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null from c:\11111111\UGII_USER_DIR\startup\SG_NX_Remote_Server.dll
Loaded assembly: Microsoft.VisualBasic, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a from C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualBasic\v4.0_10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll
*** NOTE:: in line 1503 of D:\workdir\Reference\NX903_4\src\syss\shar\ind\sys.c at Wed Jul 12 10:12:49 2017 Romance Daylight Time
+++ Cannot find method ufsta in image

Do you know whats wrong? or what can i try?

 

Thanks

Fred

2 REPLIES

Re: DLL for NX-Remote fails to load at startup

Siemens Phenom Siemens Phenom
Siemens Phenom

 

Change "Main" to "Startup".

 

 

Re: DLL for NX-Remote fails to load at startup

Genius
Genius

 

Works when i add a Startup function as integer

 

    Public Shared Function Startup() As Integer
        Start()
    End Function

Thanks!