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

DelphiXE2 and Mathcad Automation

Highlighted
Newbie

DelphiXE2 and Mathcad Automation

Hi all,

this is my first post to this forum so please be patient with me 🙂

I have troubles to use the Mathcad Automation Type Library (MathCad v15) in Delphi XE2.

When i import the library to my project, its not possible to compile anymore.

Following error occures in the source of my exe

Application.Initialize -> [DCC Error] ump.dpr(14): E2018 Record, object or class type required

Application.MainFormOnTaskbar := True; -> [DCC Error] ump.dpr(14): E2018 Record, object or class type required

Application.CreateForm(TForm1, Form1); -> [DCC Error] ump.dpr(14): E2018 Record, object or class type required

Application.Run; -> [DCC Error] ump.dpr(14): E2018 Record, object or class type required

This is how the TLB was imported::

View -> Registered Type Libraries -> Choosing Mathcad Automation API -> Import -> Adding unit to project

What am i doing wrong?

Tags (3)
1 REPLY 1

Re: DelphiXE2 and Mathcad Automation

So, i dismissed the plan to use type libraries, im using Olecontainers now. Seems to work fine.

But i have problems to use a vector or matrix as input parameter for the MCadObject.SetComplex instruction.

My source code looks like this:

procedure TForm1.CalculateDocClick(Sender: TObject);

var

arrGeom:olevariant;

begin

arrGeom:=VarArrayCreate([0,1],varVariant)

arrGeom[0]:=1;

arrGeom[1]:=2;

MCadObject.SetComplex('in0',arrGeom,EmptyParam);

MCadObject.Recalculate;

end;

How do i setup the matcad-file to work?

I tried to use this

in0 =0

and this

(a b)^T := in0

Both failed 😞

Can someone help?