NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

C# "Interface not supported" HRESULT: 0x80004002

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?

thx
Marcos V. Bischoff
0 Kudos
Message 1 of 2
(6,538 Views)

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

0 Kudos
Message 2 of 2
(6,523 Views)