Starting external application from RTC (again)

ccbryan63
Member Posts: 115
Hi... I have a pretty simple question. This
works fine in 2009 Classic. The main window of my FindItems application appears and all is right with the world. However it does not work in the RTC. wShExec is an Automation variable subtype shell.
In this case the file server, application server and client are all the same machine. Interestingly, if I watch the Task Manager, the RTC does start up a FindItems.exe process, but not an application. The Classic client starts both a process and an application.
This code is within its own codeunit that I am 'running' directly in the Classic client; in the RTC I have a menu item calling the codeunit.
So what am I missing?
CREATE(wShExec); ReturnCode := wShExec.Run('C:\FindItemsExec\FindItems.exe'); CLEAR(wShExec);
works fine in 2009 Classic. The main window of my FindItems application appears and all is right with the world. However it does not work in the RTC. wShExec is an Automation variable subtype shell.
In this case the file server, application server and client are all the same machine. Interestingly, if I watch the Task Manager, the RTC does start up a FindItems.exe process, but not an application. The Classic client starts both a process and an application.
This code is within its own codeunit that I am 'running' directly in the Classic client; in the RTC I have a menu item calling the codeunit.
So what am I missing?
0
Comments
-
Once again: the automation is created on the server - thus you cannot run the app there... ;-)
You need to create the automation as Client-side... CREATE(wShExec, false, TRUE);
Edited: I forgot the second param... :-)0 -
Yes, you need to specify that the com object should run on the server, as kine says this is done in the CREATE call. I currently use this approach:
CREATE(myCom, false, true);
where the third parameter means that it should run on the client.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT0 -
If you are running NAV2009 R2, use .NET interop and take a look at the Process class. It has a static method named Start that can easily be used.0
-
Small note on DotNet objects:
For the DotNet interop there is a property (Shift+F4) on the variable definition where it needs to be set that it is a client side dot net object. The default here is also server side.“This posting is provided "AS IS" with no warranties, and confers no rights.”
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT0 -
Thank you!! (again!)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions