Using EventPipe.TakeAll() in C#

Discussion created by tinklerj on Apr 11, 2014
Latest reply on Apr 11, 2014 by tinklerj

I can't get the following to work (note I have omitted the code that gets the EventPipe from a PointList.Data):

EventPipe evtPipe;     
// ... omit getting event pipe from a PointList.Data 
PIEventObject[] eventsRetrieved;
// Get runtime InvalidCastException: Unable to cast object of type 'System.Object[]' to type 'PISDK.PIEventObject[]'.
eventsRetrieved = (PIEventObject[])evtPipe.TakeAll();

What's wrong with that cast?


And on a similar subject:


When I have finished with the event pipe I want it to stop getting events.  If I just set the variable evtPipe to null will that do it?  If not, how?