Showing results for 
Search instead for 
Did you mean: 

Remote call of methods of my DLL

Valued Contributor
Valued Contributor
I have DLL (in c#) where I work with NX 10.
NX loads DLL while starting (startup function)
Earlier I have created 2 buttons in NX and assign actions to them:
       theUI.MenuBarManager.AddMenuAction("Action1", new NXOpen.MenuBar.MenuBarManager.ActionCallback(Program.Action1Btn));
       theUI.MenuBarManager.AddMenuAction("Action2", new NXOpen.MenuBar.MenuBarManager.ActionCallback(Program.Action2Btn));
Buttons works correctly.
Now I need to link third-party application to NX. I must perform next steps:
1) Open NX. If NX is already opened, it is necessary to get list of opened documents
2) Open document and make it active
3) Call one of the methods of my DLL
In another programs I can accomplish step 1 and step 2 via COM object, however I haven't found any information about COM Sever in NX.
I tried to write my own "automation server" using 
a) Named pipes (NamedPipeServerStream) 
b) RemotingServices
In all cases separate thread is created and ran in the Startup() method of DLL.
I managed to get "remote" access to my DLL and work in this channel.
But next problem has occured:
Program throws an exceprton or simply doesn't respond when it is trying to work with methods of my DLL.
I managed to get access to Session, UFSession and UI using RemotingServices. I was enough to accomplish step 1 and setp 2.
How can I call methods of my DLL from third-party application?