Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-03

Win32 Swedish Locale "Failed to create win32 control"

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Brad Campbell

I have an application created with Lazarus. One user is getting this message when I create a form. He's the only user that is seeing it, and the only thing different about his system is it is running XP-SP3 Swedish.

TAboutForm is a basic form with some labels, a memo and a TBitmap on it. The code that creates it is as follows, and it never makes it past the create call.

When it's reproducible it's 100% reproducible and stays constant. The problem is whether it happens varies from build to build (let's say out of 7 builds it has happened 3 times). It's got me stuffed. I'm in the process of acquiring a copy of Swedish XP to test on in a VM, but as he's over the other side of the globe from me, and asking him to download lots of 30MB debug builds is a bit onerous, I thought I'd ask here also.

I have absolutely no idea as to what is going on, but this has only been a problem since I upgraded to 2.4.0 (I'm running fpc 2.4 fixes branch svn : r14896 and the App was built with Lazarus svn : r23855)

There are 19 forms in this application, and this is the *only* one it happens with !?!

procedure Tbstmainform.MenuAboutClick(Sender: TObject);
Var
    About : TAboutForm;
    ZS : TDecompressionStream;
    Res : TResourceStream;
begin
   About := TAboutForm.Create(bstmainform);

Exception :

TApplication.HandleException Failed to create win32 control, error: 0 : ?tg?rden har slutf?rts.
Stack trace:
$0055994D FINISHCREATEWINDOW, line 225 of win32wscontrols.pp $0052D7EF TWIN32WSCUSTOMMEMO__CREATEHANDLE, line 1288 of win32wsstdctrls.pp $004D7982 TWINCONTROL__CREATEWND, line 7018 of ./include/wincontrol.inc $00519A1A TCUSTOMEDIT__CREATEWND, line 31 of ./include/customedit.inc $004D7585 TWINCONTROL__CREATEHANDLE, line 6919 of ./include/wincontrol.inc $004D85CA TWINCONTROL__HANDLENEEDED, line 7379 of ./include/wincontrol.inc $004D7B51 TWINCONTROL__CREATEWND, line 7047 of ./include/wincontrol.inc $004158A1 TSCROLLINGWINCONTROL__CREATEWND, line 32 of ./include/scrollingwin control.inc
$0041A29F TCUSTOMFORM__CREATEWND, line 2137 of ./include/customform.inc $0041B229 TFORM__CREATEWND, line 2538 of ./include/customform.inc $004D7585 TWINCONTROL__CREATEHANDLE, line 6919 of ./include/wincontrol.inc $004D2E0A TWINCONTROL__UPDATESHOWING, line 4207 of ./include/wincontrol.inc $0041A84D TCUSTOMFORM__UPDATESHOWING, line 2351 of ./include/customform.inc $004D60FD TWINCONTROL__UPDATECONTROLSTATE, line 5971 of ./include/wincontrol .inc
$004D942B TWINCONTROL__CMVISIBLECHANGED, line 7813 of ./include/wincontrol.i nc
$0040B8BA TOBJECT__DISPATCH, line 467 of /home/brad/devel/fpc/fpc_2.4.0/fpc/ rtl/inc/objpas.inc
$004D4A32 TWINCONTROL__WNDPROC, line 5116 of ./include/wincontrol.inc

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

José Mejuto
to Brad Campbell

Hello Lazarus-List,

Monday, March 15, 2010, 3:52:26 PM, you wrote:

BC> Exception :
BC> TApplication.HandleException Failed to create win32 control, error: 0 : +tg?rden BC> har slutf?rts.
BC> Stack trace:
BC> $0055994D FINISHCREATEWINDOW, line 225 of win32wscontrols.pp

CreateWindowsExW returns NULL, so an error in the creation of the control happends, but GetLastError returns zero which usually means no error :-?

Had you tested your code with heaptrc ? To me it looks like a memory corruption. I was unable to seen nothing that could be related to swedish locale, or any other locale. I think that a copy of that specific form could help, but as the exception appears only in some "builds" it strongly make me think in a memory corruption.

Which Lazarus and fpc are you using ?

Best regards, Jos?

Reply by email

Brad Campbell
to José Mejuto
Jos? Mejuto wrote 19 lines
Hello Lazarus-List, Monday, March 15, 2010, 3:52:26 PM, you wrote: BC> Exception : BC> TApplication.HandleException Failed to create win32 control, error: 0 : +tg?rden BC> har slutf?rts. BC> Stack trace: BC> $0055994D FINISHCREATEWINDOW, line 225 of win32wscontrols.pp CreateWindowsExW returns NULL, so an error in the creation of the control happends, but GetLastError returns zero which usually means no error :-? Had you tested your code with heaptrc ? To me it looks like a memory corruption. I was unable to seen nothing that could be related to swedish locale, or any other locale. I think that a copy of that specific form could help, but as the exception appears only in some "builds" it strongly make me think in a memory corruption.

Yes, I test with heaptrc regularly. The thing is this has a couple of hundred users scattered around the place, but this guy is the only one with the problem and as far as I know he's the only one using a localised version of windows. I've been through the code in the backtrace, and I can't find any sane reason either, but I thought I'd ask as I'm not really up on win32.

Which Lazarus and fpc are you using ? (I'm running fpc 2.4 fixes branch svn : r14896 and the App was built with Lazarus svn : r23855)

I've attached that form for reference if it helps.

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish. -------------- next part -------------- A non-text attachment was scrubbed... Name: about.zip Type: application/zip Size: 64376 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100316/6494631b/attachment-0001.zip>

Reply by email

Martin
to Brad Campbell
Brad Campbell wrote 40 lines
Jos? Mejuto wrote: > Hello Lazarus-List, > > Monday, March 15, 2010, 3:52:26 PM, you wrote: > > BC> Exception : > BC> TApplication.HandleException Failed to create win32 control, > error: 0 : +tg?rden > BC> har slutf?rts. > BC> Stack trace: > BC> $0055994D FINISHCREATEWINDOW, line 225 of win32wscontrols.pp > > CreateWindowsExW returns NULL, so an error in the creation of the > control happends, but GetLastError returns zero which usually means no > error :-? > > Had you tested your code with heaptrc ? To me it looks like a memory > corruption. I was unable to seen nothing that could be related to > swedish locale, or any other locale. I think that a copy of that > specific form could help, but as the exception appears only in some > "builds" it strongly make me think in a memory corruption. Yes, I test with heaptrc regularly. The thing is this has a couple of hundred users scattered around the place, but this guy is the only one with the problem and as far as I know he's the only one using a localised version of windows. I've been through the code in the backtrace, and I can't find any sane reason either, but I thought I'd ask as I'm not really up on win32. > Which Lazarus and fpc are you using ? >(I'm running fpc 2.4 fixes branch svn : r14896 and the App was built with Lazarus svn : r23855) I've attached that form for reference if it helps. Regards, Brad

Not sure if it is strictly locale related. I run into the exact same error/stacktrace today. Happened with lazarus itself (when I tried to open the "debug /debug output" window (the debug log memo win)). It happened just once, and I could not reproduce it. It happened after a long debug session, so it may have been the content of the memo?

Running on an english Windows Vista.

Reply by email

Brad Campbell
to Martin
Martin wrote 49 lines
On 16/03/2010 00:40, Brad Campbell wrote: > Jos? Mejuto wrote: >> Hello Lazarus-List, >> >> Monday, March 15, 2010, 3:52:26 PM, you wrote: >> >> BC> Exception : >> BC> TApplication.HandleException Failed to create win32 control, >> error: 0 : +tg?rden >> BC> har slutf?rts. >> BC> Stack trace: >> BC> $0055994D FINISHCREATEWINDOW, line 225 of win32wscontrols.pp >> >> CreateWindowsExW returns NULL, so an error in the creation of the >> control happends, but GetLastError returns zero which usually means no >> error :-? >> >> Had you tested your code with heaptrc ? To me it looks like a memory >> corruption. I was unable to seen nothing that could be related to >> swedish locale, or any other locale. I think that a copy of that >> specific form could help, but as the exception appears only in some >> "builds" it strongly make me think in a memory corruption. > > Yes, I test with heaptrc regularly. The thing is this has a couple of > hundred users scattered around > the place, but this guy is the only one with the problem and as far as > I know he's the only one > using a localised version of windows. I've been through the code in > the backtrace, and I can't find > any sane reason either, but I thought I'd ask as I'm not really up on > win32. > >> Which Lazarus and fpc are you using ? > > >(I'm running fpc 2.4 fixes branch svn : r14896 and the App was built > with Lazarus svn : r23855) > > I've attached that form for reference if it helps. > > Regards, > Brad Not sure if it is strictly locale related. I run into the exact same error/stacktrace today. Happened with lazarus itself (when I tried to open the "debug /debug output" window (the debug log memo win)). It happened just once, and I could not reproduce it. It happened after a long debug session, so it may have been the content of the memo? Running on an english Windows Vista.

Now that is interesting.

I create the form, then I load the memo from a compressed stream and call the forms showmodal method. I assumed the crash was during the form's creation, so it never gets to the stage where it loads the memo.

In the case of this crash though it happens on a clean start. He fires up the application and goes to Help->About and it blows up. It is at least helpful that it's reproducible on his machine, it's just that his machine is in Sweden and I'm not :)

I've installed Swedish XP-PRO-SP3 & XP-Home in a VM (which was a challenge in itself, Bork Bork Bork!) but I can't reproduce the fault locally.

Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.

Reply by email

Hans-Peter Diettrich
to Brad Campbell
I've installed Swedish XP-PRO-SP3 & XP-Home in a VM (which was a challenge in itself, Bork Bork Bork!)

<OT>
Have you ever tried to install a Chinese Windows? I did once, in the Win 3.1 age, when I knew all the buttons to press blindly. Only after the installation I could switch into English mode...

DoDi

Reply by email