cancel
Showing results for 
Search instead for 
Did you mean: 

NX Open: Run exe program interactively

Hi,
Is it posible to run exe programs (VB.net) interactively in NX session?
When i try to do so with program which works perfectly as dll in exe variant it cause error: "Failed to load image - see log file for details. File name ... Function name: ufuser"
In the log was writen:
&MACRO FILE_BOX -2, D:\Temp\TheProgram.exe D:\Temp\*.EXE 0 ! Execute User Function

The reason D:\Temp\TheProgram.exe failed to load was:
Cannot classify image D:\Temp\TheProgram.exe
&MACRO FOCUS CHANGE OUT 1
&MACRO FOCUS CHANGE OUT 1
&MACRO FOCUS CHANGE IN 1
&MACRO MESSAGE_BOX -2 Failed to load image - see log file for details
&MACRO MESSAGE_TEXT
&MACRO MESSAGE_TEXT File name: D:\Temp\TheProgram.exe
&MACRO MESSAGE_TEXT
&MACRO MESSAGE_TEXT Function name: ufusr
&MACRO MESSAGE_TEXT
&MACRO MENU, 0, UG_HELP_SYSTEM_LOG UG_GATEWAY_MAIN_MENUBAR <MenuBar->UG_HELP> ## !

5 REPLIES

Re: NX Open: Run exe program interactively

Siemens Phenom Siemens Phenom
Siemens Phenom

 

If the program is built from NXOpen .Net, then you should be able to run the .EXE inside an interactive session of NX.

 

If it is built from C/C++, then it will fork another process, and will not be aware of or connected to anything that is going on in NX.

 

That looks like a 32-64-bit mismatch.  Make sure you built the .EXE to match your NX.

 

Re: NX Open: Run exe program interactively

Esteemed Contributor
Esteemed Contributor

.NET executables can be build to be independent of 32 or 64-bit processes, you need to select any processor in the compiler options.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: NX Open: Run exe program interactively

Siemens Phenom Siemens Phenom
Siemens Phenom

Stefan,

 

That was true for a long time.  I discovered that when I built a .EXE using the NXOpen wizard for NX9, the program would not run if Any CPU was the target.

 

The solution was to set it to x64 - NX9 is only available as a 64-bit app.

 

Alexander did not mention what version of NX he is running, but if it is NX9, I think he will have to build his .EXE as "x64.

 

I seem to remember that you do not use the Studio, so if it works differently with your method, I would be interested to hear about that.

 

Regards,

 

Steve

 

Re: NX Open: Run exe program interactively

Esteemed Contributor
Esteemed Contributor

I do have a file translation service running on a server to translate STEP, IGES, etc. to NX and vise verse through a NXOpen EXE.

The compiler option is set to "any processor" for target CPU.

The platform is set to x86, since AnyCPU was not available at the time the solution was build.

Now I use AnyCPU for my NXOpen DLLs, since it is now an option.

 

The service is running on Windows Server 2008 R2 and NX 8.5 64-bit is installed.

 

Works like a charm Smiley Wink

 

I am currently using SharpDevelop 4.4 for my NXOpen API programming.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: NX Open: Run exe program interactively

Siemens Phenom Siemens Phenom
Siemens Phenom

 

Stefan,

 

I think the key here is that you are running in NX8.5.  This problem never occurred until NX9.

 

I submitted a PR for it last year, and it is reported to be fixed in NX10, although I don't know offhand if we fixed the wizard to target the x64 platform, or if we can run Any CPU executable images in NX10.

 

I can easily duplicate Alexander's error in NX9. 

 

Regards,

 

Steve