Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations Ron247 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NX9 Journal for .EXE File

Status
Not open for further replies.

Kenja824

Automotive
Nov 5, 2014
958
I posted some months ago about this same problem.
[URL unfurl="true"]http://www.eng-tips.com/viewthread.cfm?qid=377516[/url]
One of the problems coming to a solution was that due to privacy issues I was not allowed to post anything with the name of the company who made the .exe file nor the name of the file. So I was even told by my bosses that I couldn't post the details of the error.

Well due to the fact they are pushing me to get this done now, I am going to try and post the details of the error and just X out any info I believe could be a privacy problem. And hope I don't miss any. lol

When I go to FILE - EXECUTE - NX OPEN and select their file, it will run perfect and at the end, a dialog box will open for me to choose an option of how to continue. These options will work perfect. HOWEVER, if I use a macro that runs the EXE file the same way, the file seems to work fine until the option dialog box opens up. Then it does not continue when I select my option. Because the file runs as soon as I select it in the recording, I never get a chance to stop recording until the program is done. I tend to think that the macro is still trying to run while the program runs and it causes a problem with selecting options.

In the thread I linked to above, someone gave me a journal code to run the program. Others tried it for other programs and it seems to work for them, but for this program it gets an error....

Microsoft .NET Framwork
The type initializer for "XXXX.Main' threw an exception.

DETAILS.... (Note* Any privacy possibilities have been replaced with XXXX)

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'XXXX.Main' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'NXOpen, Version=9.0.0.19, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at XXXXX.Main..cctor()
--- End of inner exception stack trace ---
at XXXX.frmReport.sCreateReportHeader()
at XXXX.frmReport.frmReport_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



I am hoping someone might know by this info what I can do or try, to fix the problem. Whether anyone can help or not, I want to thank you ahead of time for any effort you put into this. :eek:)
 
Replies continue below

Recommended for you

Other programs they have given us are in DLL files and those work fine. I am wondering if there was a .DLL file that runs the exe file, if that would solve the problem. My knowledge in this area is so minimal, it is okay to laugh at that idea. :eek:)
 
What's your goal? It appears that you just want to create a button to start this exe?
If so, I think phillpd gave you the answer in your previous thread...
 
As stated above, the code I was given seems to work for everyone else, but errors out on the programs we received from this other company. I was hoping that someone might be able to look at the error (in red) and tell me a possible reason why the code wont work. If not, then I was wondering if we had them create a DLL file that runs the exe file (if that is even possible) if that would work since all of their DLL files seem to work perfect.
 
Kenja824 said:
When I go to FILE - EXECUTE - NX OPEN and select their file, it will run perfect... HOWEVER, if I use a macro that runs the EXE file the same way...

So, why are you trying to start the exe with a macro?
 
Mainly because we will have multiple people needing to use the programs from this other company. For some strange reason this company changes the names of the files and such when they send us up dated files. On top of that, many of who will use these programs will be checkers who are older and not good with computers to begin with. We could create the buttons manually through the Customize ad new command, but I would have to go into each individual computer to add it. Then if the updates call for me to change them, I would have to go into each computer individually again. This is time consuming and a hassle.

What we are trying to do is to use a TBR file and create buttons that can simply be opened on their computers and all are connected to one source. Then updates and installs will be simple. Unfortunately, I can only get the TBR file to run Macros or Journals. I messed around with just directing it right to the exe file and that doesn't seem to be an option from what I read on-line.
 
There are examples in the menuscript help files on how to start an executable through the menu entry; does this not work for you?

Some speculation on my part:
Since it is an exe file, it was probably meant to run in 'batch' mode. Perhaps it needs the file name to process passed to it as a 'command line argument'. This doesn't explain why "execute -> nxopen" works with the file, perhaps the "execute" command automatically passes the current file to the exe? I'm not sure.

If the help file examples don't work in this case, it might be time to call GTAC. They would be in a better position to analyze your setup.

www.nxjournaling.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor