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.
--
Carlos Germán Tejero
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) break fpc_raiseexception
Breakpoint 1 at 0x40a686
(gdb) run
Starting program: E:\projects\VisualDaVinci2/davinci.exe
[New thread 3580.0xd58]
Breakpoint 1, 0x0040a686 in fpc_raiseexception ()
(gdb) backtrace
#0 0x0040a686 in fpc_raiseexception ()
#1 0x0052ed25 in FINISHCREATEWINDOW (AWINCONTROL=0x1a4ad8, PARAMS=
{BUDDY = 0, PARENT = 0, WINDOW = 0, LEFT = -4, TOP = -30, HEIGHT = 120,
WIDTH = 810, WINDOWINFO = 0x221fcbc, BUDDYWINDOWINFO = 0x1a4bdc, MENUHANDLE =
0, FLAGS = 114032640, FLAGSEX = 0, SUBCLASSWNDPROC = 0x0, STRCAPTION = 0x0,
WINDOWTITLE = 0x0, PCLASSNAME = 0x5eaa30 "Window"}, ALTERNATECREATEWINDOW=false)
at win32wscontrols.pp:222
#2 0x00534495 in TWIN32WSCUSTOMFORM__CREATEHANDLE (AWINCONTROL=0x1a4ad8,
APARAMS=
{CAPTION = 0x601d08 "", STYLE = 67108864, EXSTYLE = 0, X = 0, Y = 0,
WIDTH = 802, HEIGHT = 86, WNDPARENT = 0, PARAM = 0x0, WINDOWCLASS = {STYLE = 0,
LPFNWNDPROC = 0x0, CBCLSEXTRA = 0, CBWNDEXTRA = 0, HINSTANCE = 0, HICON = 0,
HCURSOR = 0, HBRBACKGROUND = 0, LPSZMENUNAME = 0x0, LPSZCLASSNAME = 0x0},
WINCLASSNAME = '\0' <repeats 63 times>}, pvmt=0x152bf0) at win32wsforms.pp:319
#3 0x004a4a1a in TWINCONTROL__CREATEWND (this=0x1a4ad8)
at wincontrol.inc:6589
#4 0x004135c1 in TSCROLLINGWINCONTROL__CREATEWND (this=0x1a4ad8)
at scrollingwincontrol.inc:41
#5 0x00417dcc in TCUSTOMFORM__CREATEWND (this=0x1a4ad8)
at customform.inc:1857
#6 0x00418a79 in TFORM__CREATEWND (this=0x1a4ad8) at customform.inc:2192
#7 0x004a4675 in TWINCONTROL__CREATEHANDLE (this=0x1a4ad8)
at wincontrol.inc:6517
#8 0x004a564a in TWINCONTROL__HANDLENEEDED (this=0x1a4ad8)
at wincontrol.inc:6908
#9 0x0041d43e in TAPPLICATION__CREATEFORM (INSTANCECLASS=<incomplete type>,
REFERENCE=void, this=0x167b48) at application.inc:1851
#10 0x0040295c in main () at davinci.lpr:36_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus