AnsweredAssumed Answered

TriggerSetup with IApplication

Question asked by satrimb on May 5, 2009
Latest reply on May 6, 2009 by satrimb
Using C#, I'm trying to set the trigger options for a PNA-X.  However, IApplication does not contain the TriggerSetup object.  "Application" does contain the TriggerSetup object, but I can't run using the "Application" object.  I get the following error at run-time:

Unable to cast COM object of type 'System.__ComObject' to interface type 'AgilentPNA835x.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{C217BE41-99CB-465C-A08C-0A6E03473B92}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

Using the IApplication object compiles fine.  Failing code is below:

AgilentPNA835x.Application pna = null;
Type pnaType = Type.GetTypeFromProgID("AgilentPNA835x.Application", "");
pna = (AgilentPNA835x.Application)Activator.CreateInstance(pnaType);

Is there something obvious that I'm missing (I'm new to C# so it wouldn't be a shocker), or is there another way to access the TriggerSetup object?