bug in wxCreateHiddenWindow function

Robert Roebling robert at roebling.de
Sat Aug 25 02:00:24 PDT 2007


Eran Ifrah wrote:

> I tried to call wxExecute from within a dll (does it matter?), however
> I am getting an assertion
> 'failed to create hidden window for wxExecute'. Stepping into WX
> sources, I found the bugged line: 
> 
> at utils.cpp, line 1533 (in function wxCreateHiddenWindow()):
> 
> if ( !::RegisterClass(&wndclass)  )
> {
>     [...]
> }
> 
> the above condition should be modified to:
> if ( !::RegisterClass(&wndclass)  && GetLastError() !=
> ERROR_CLASS_ALREADY_EXISTS ) 
> 
> I have tested it and with my fix, the code works properly (I am
> getting the process termination event).

Maybe ::RegisterClass(&wndclass) should only get called once?
It doesn't seem obviously right to ignore an error message.

  Robert






More information about the wx-users mailing list