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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

API Mathcad

Irenee
3-Visitor

API Mathcad

I am using Mathcad Prime 6.0 6.0.0.0

Dear Support,
I have downloaded the C# WPF project for using the API Mathcad (https://support.ptc.com/help/mathcad/r7.0/en/index.html#page/PTC_Mathcad_Help%2Fexample-2_ms_dev_studio.html%23) but it does not work (Problem to connect Mathcad Prime).
I'm using Prime 6.0.
Is this version compatible with your API ?
Thanks
Regards,
Irénée


Here are the errors that I faced
ex.Message = "Retrieving the COM class factory for component with CLSID {A00E8B95-D415-433F-A04E-D298A54A7BB7} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))."

1 ACCEPTED SOLUTION

Accepted Solutions
VladimirN
24-Ruby II
(To:Irenee)
9 REPLIES 9
VladimirN
24-Ruby II
(To:Irenee)

 Hi Irénée,

 

1Submit your issue here: https://support.ptc.com/apps/case_logger_viewer/cs/auth/ssl/log 

2. Read this article - "How to solve COM Exception Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))?": https://stackoverflow.com/questions/1496214/how-to-solve-com-exception-class-not-registered-exception-from-hresult-0x80040 

Thanks for the answer Vladimir.

I tried to change the target platform "x86", "x64", "Any CPU", without success.

The problem occurs when I want to start Mathcad (error during the instanciation "_mathcadPrimeApplication = new Ptc.MathcadPrime.Automation.ApplicationCreator();")

Regards,

Irénée

VladimirN
24-Ruby II
(To:Irenee)

 Irénée,

 

What if you run the example in an attachment?

Hello Vladimir,

I have the same error message.

In the source code, we have two ways for launching Mathcad Prime:

The active way is by using constructor. By this way I have the error message during the instantiation.

The other way is to using Activator (needs to uncomment the following lines):

Type typeofOpPrimeserver = Type.GetTypeFromProgID("MathcadPrime.Application");
_mathcadPrimeApplication = Activator.CreateInstance(typeofOpPrimeserver) as IMathcadPrimeApplication3;

By trying this other way, I retrieve a null type for typeofOpPrimeserver. I tried with another prog ID as "MathcadPrime.Application", but the type is always null.

By curiosity, I tried with just "Mathcad.Application" as prog ID, and in this case the type is not null. But the following code does not work, probably we need to launch MathcadPrime, not Mathcad.

Thanks,

Irénée

VladimirN
24-Ruby II
(To:Irenee)

Vladimir, I confirm that it works with Mathcad Prime 7.0.

Thanks.

Happy new year,

Irénée

VladimirN
24-Ruby II
(To:Irenee)

I'm glad you solved your problem!

GJS
5-Regular Member
5-Regular Member
(To:VladimirN)

This really is a poor answer, for those who have not yet upgraded to version 7.0. 

GJS
5-Regular Member
5-Regular Member
(To:Irenee)

Are there any valid answers that do not include purchasing an entirely new version of Mathcad??

Top Tags