02-28-2014 03:39 AM
Hi there.
I am trying implement a C# gui app that genreates a Sequencefile based on a text files content.
ie. Sequence_2 12133 will create a Step and call teh "Sequence_2" with given Parameters.
When executing i get the following error. => (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
It seems that the the cast of a object is not supported ( see attached screenshot) when calling
SequenceCallModule scm = (SequenceCallModule)step.Module;
I am developing with VS 2010 on a Win 7 x86 and using Teststand 5.1 with a .NET 4.0.
I already tried to play with the "Embed Interop Types" property of the referenced assemblies with no success.
Anyone got a smart idea?
Waht does the NI support know about this?
02-28-2014 09:21 AM
Casting is supported, but if the module is not a sequence call module and you use a cast, you will get an error like that. It might be better if you did something more like the following:
SequenceCallModule scm = step.Module as SequenceCallModule;
if (scm)
{
// things you do with sequence call modules
}
else
{
// things you want to do if it's not a sequence call module.
}
Do not use "Embed Interop Types" with the TestStand interop assemblies. That feature does not work with enums (at least in Visual Studio 2010) and TestStand has lots of enums.
-Doug