Put virtual channel handling into a separate file since both the DLL and the main program will use it.