这是我的代码,VS2012 C# Express 抱怨接口 PISDK._DEventPipeEvents 中的两个成员没有实现,这里快速粘贴:
namespace PISDK
{
[Guid("9E679FD2-DE8C-11D3-853F-00C04F45D1DA")]
[InterfaceType(2)]
[TypeLibType(4096)]
public interface _DEventPipeEvents
{
[DispId(2)]
void OnNewValue();
[DispId(1)]
void OnOverflow(object vtEvent, OverflowCauseConstants Cause);
}
}
这是我的代码:
class PointListEventPipeEventReceiver : PISDK._DEventPipeEvents
{
private PISDK.EventPipe eventPipe;
public PointListEventPipeEventReceiver(PISDK.EventPipe eventPipe)
{
this.eventPipe = eventPipe;
}
public void PISDK._DEventPipeEvents.OnNewValue()
{
Console.WriteLine("New value event");
handleNewValue(eventPipe);
}
public void PISDK._DEventPipeEvents.OnOverFlow(object vtEvent, PISDK.OverflowCauseConstants Cause)
{
throw new NotImplementedException();
}
private void handleNewValue(PISDK.EventPipe eventPipe)
{
Console.WriteLine("Handling new value");
Array eventObjs = eventPipe.TakeAll();
Console.WriteLine("eventObjs.Length==" + eventObjs.Length);
foreach (PISDK.PIEventObject piEventObj in eventObjs)
{
Console.WriteLine(piEventObj.EventData as PISDK.PointValue);
}
}
}
我在这里不知所措,任何帮助都很好。