cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Connecting to different instances of Mathcad prime 4

pklemm-2
6-Contributor

Connecting to different instances of Mathcad prime 4

I am using Mathcad Prime SDK 3.1 for Mathcad Prime 4 to automate some time consuming calculations and worksheet management. As described in SDK, the communication is done over an

ApplicationCreatorClass() call. This works more ore less fine but I cannot control to which running Mathcad instance the link will be performed. My question is: Is there any way to establish connections to different  Mathcad instances running on the same computer?

6 REPLIES 6
LucMeekes
23-Emerald III
(To:pklemm-2)

Is there any way you can get the process ID number (PID) of the application instance that you are connecting/ connected to?

 

Luc

pklemm-2
6-Contributor
(To:LucMeekes)

Yes. I can get PIDs of all running instances with

System.Diagnostics.Process.GetProcesses().

I tried another way with OLE32.dll:

Reading out the ROT (running object table) with the IMoniker interface, as it is described for EXCEL connection. After getting a running COM object instance the .Net interface or class must be known like here:

if (lComObject is Microsoft.Office.Interop.Excel.Workbook)

{

Microsoft.Office.Interop.Excel.Workbook lExcelWorkbook = (Microsoft.Office.Interop.Excel.Workbook)lComObject;

...

}

I tried to substitude "Microsoft.Office.Interop.Excel.Workbook" with the automation interface class of Mathcad and also with its Application class but there was no match.

 

 

 

 

pklemm-2
6-Contributor
(To:LucMeekes)

Hello LucMeekes,

excuse me that I ask you directly, but there is nobody here who has experiences in that except You.

I am always looking for the solution of connecting to different instances of mathcad.
Do you have any more suggestions for me?

Hello,

 

did you already ask PTC Support ? If not, please give them a chance...


Martin Hanák
pklemm-2
6-Contributor
(To:MartinHanak)

Thank you,

I didnt but I will do now a request.

You can use the "Case Logger" tool on PTC's eSupport portal to open technical support case: https://support.ptc.com/apps/case_logger_viewer/auth/ssl/log

Top Tags