[Lazarus] Error when create a main window
Vincent Snijders
vincent.snijders at gmail.com
Tue Jan 20 09:13:31 CET 2009
2009/1/20 Carlos German Tejero <german_tejero at yahoo.com.ar>:
> Hi, i'm using lazarus v0.9.27 r18334 i386-win32-win32/win64 and fpc 2.2.3 on
> a WindowsXP64.
> I try to port a delphi program to lazarus/fpc, but when create then main
> window, the program raise an exception.
> The exception raise in Win32WSControls unit:
>
> ....
> {$ifdef WindowsUnicodeSupport}
> if UnicodeEnabledOS then
> Window := CreateWindowExW(FlagsEx,
> PWideChar(WideString(pClassName)), //<<<--- Return 0
> PWideChar(Utf8Decode(WindowTitle)), Flags,
> Left, Top, Width, Height, Parent, MenuHandle, HInstance, nil)
> else
> Window := CreateWindowEx(FlagsEx, pClassName,
> PChar(Utf8ToAnsi(WindowTitle)), Flags,
> Left, Top, Width, Height, Parent, MenuHandle, HInstance, nil);
> {$else}
> Window := CreateWindowEx(FlagsEx, pClassName,
> PChar(WindowTitle), Flags,
> Left, Top, Width, Height, Parent, MenuHandle, HInstance, nil);
> {$endif}
>
> if Window = 0 then
> begin
> raise exception.create('failed to create win32 control, error:
> '+IntToStr(GetLastError())); //<<<-- Raise then exception
> end;
> ...
>
> The attached file "error.txt" is a backtrace.
>
> Any help or suggestion are welcome!!!!
> Sorry my null english.
If you continue to run it, what is the exception message (or the GetLastError)?
Vincent
More information about the Lazarus
mailing list