Multiple instances in COM Automation

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Rits
Posts: 6
Joined: Tue Jun 26, 2012 9:30 am

Multiple instances in COM Automation

Postby Rits » Thu Jul 26, 2012 7:19 pm

Is it possible to call multiple instances of EViews simultaneously from different classes in a C# project?
I am trying to call a wf on a button click and run some forecasts, and I am attempting to do this simultaneously across multiple forms.
I know I can use GetApplication with New/Existing/NewOrExisting settings. But I have faced some issues trying to do this and at times EViews would not run the intended forecast.

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Multiple instances in COM Automation

Postby EViews Steve » Fri Jul 27, 2012 7:43 am

If you have multiple instances of EViews running, the only way to connect to a specific instance is to know the Process ID (PID) of that particular instance. The EViews Manager class provides a method called GetApplicationByProcess that allows you to specify the PID.

This method was added to support EViews Database EDX developers that have access to EViews PID when they are initialized by EViews itself. Unfortunately, we don't provide a way to get this PID value after getting an EViews Application instance. (Perhaps we need to add a GetPID() method.)

If you use a utility like Process Explorer (http://technet.microsoft.com/en-us/sysi ... s/bb896653), you can see the PID value for any running instance of EViews. Or if you kick off an instance of EViews from your program, then look for the PID programmatically (using Windows calls to look for EViews7.exe), you can keep track of which is which.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests