NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Engine component causes: "Compiler errors occurred when generating a Windows Forms wrapper..."

I got this error when I tried to drop a TestStand Engine class onto my main form in VisualStudio.NET.

Compiler errors occurred when generating a Windows Forms wrapper for ActiveX control 'AxNationalInstruments.TestStand.Interop.API'

The error message went on to say that it saved the source in ./obj/AxInterop.TS.cs so I added that to the project. When I try to build it, I get this error:

The designer must create an instance of type 'System.Windows.Forms.AxHost' but it cannot because the type is declared as abstract.


I am using TestStand 3.0 evaluation, Version 7.1.3088 of Microsoft Development Environment 2003, and .NET Framework 1.1 Version 1.1.4322 SP1.

Is this aximp.exe problem?

Can someone suggest how to fix this?
Thanks,
Jeff
0 Kudos
Message 1 of 6
(3,463 Views)
Hi Jeff,

This error is rather unusual, but occasionally happens with many different ActiveX controls. Whenever a .NET application needs to reference an ActiveX DLL, it needs to create a wrapper to access this unmanaged code. For some reason, Visual Studio is having a great deal of trouble on your machine. One way to get around this is to generate the wrapper manually. This can be done by using the aximp.exe utility manually.

Best Regards,
Allen P.
National Instruments
0 Kudos
Message 2 of 6
(3,431 Views)
Allen,
Thanks for the quick reply.

Question: Since dragging "TestStand Engine Class" onto my panel doesn't work for me, which .dll or .ocx file do I need to wrap with aximp.exe to manually create the wrapper?
0 Kudos
Message 3 of 6
(3,418 Views)
The TestStand Engine class can be found in teapi.dll in the /BIN/ folder. You should be able to wrap this and call the engine correctly.

Adam B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,382 Views)
TestStand installs pre-built interop wrappers for the TestStand engine and all the TestStand UserInterface controls. You can find them in \API\DotNet\Assemblies\CurrentVersion\.

However, the best thing to do is usually to add the ApplicationMgr control to your .NET form and then call form.axApplicationMgr1.GetEngine() to get the engine. Doing this automatically adds references to the interop assemblies to your project. You can find this control in the TestStand tab of your .NET toolbox when you have a form active.

Ideally, you should start with the .NET simple operator interface examples which are in \OperatorInterfaces\NI\Simple\CSharp\ and \OperatorInterfaces\NI\Simple\VB.Net\

- James
0 Kudos
Message 5 of 6
(3,371 Views)
By using the pre-built wrappers in \API\DotNet\Assemblies\CurrentVersion\, I was able to add an ApplicationMgr to my C# application.

I am now able to call GetEngine() on the ApplicationMgr and do things with the engine like call GetSequenceFileEx() on it.

So I guess I'm off to the races! Thanks to all of you for the assistance.

Jeff
0 Kudos
Message 6 of 6
(3,334 Views)