Whenever I try to build a cdi image I get this message

Can't create window of class wxWindowClassNR (error 1400: invalid window handle.)
Can somebody help me?