Is h_Instance the same as hinstance. Those should be the same. I guess you should use hinstance both places.