You will use the InstallEventHandler function. You can use it to install an event for any event mask that you want. Then you can just override the OnEvent virtual member of the class and handle the event however you like. You can also install an external (outside the class) function to handle the event, but since you are deriving from CNi4882Device, it would make more sense to override the virtual member OnEvent. See the online help for CNi4882::InstallEventHandler and CNi4882::OnEvent for more help.
Best Regards,
Chris Matthews
National Instruments