switch dthost to c++