Re: Win32Lib Combo / Tabs

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert Craig wrote

> First, copy euphoria\include\safe.e into the current directory,
> and rename it as machine.e. Then run your program a few times,
> in various ways, and see if safe.e catches anything.
>
> If safe.e doesn't catch anything, send me the code
> and I'll look into it.

I've tried that, and I've found a problem with using safe.e with windows.
Sometimes, you get handed a pointer from the OS (which won't be logged in
safe.e) such as NMHDR structures in WM_NOTIFY messages.  safe.e tells me
I've got a 'Bad peek4s address', which isn't really true, of course.

However, I've done some more extensive testing, and I can't see a reason why
the call to ChildWindowFromPointEx should fail.  It's not simply an open dos
box, although it does fail if the trace screen has been activated.  And it
fails with safe.e (but no errors are reported by safe.e).  I don't
understand why this should be, unless safe.e allocates some memory on it's
own (very possible--I didn't really examine safe.e too carefully) that isn't
freed before the controls are created.

It only takes a tiny bit of code to test:

-- Begin combo.exw

include win32lib.ew -- v0.53

constant
Win = create( Window, "Main Window", 0, 0, 0, 500, 500, 0),
WinCombo1 = create( Combo, "Combo", Win, 10, 20, 90, 90, 0),
WinCombo2 = create( Combo, "Combo", Win, 10, 60, 90, 90, 0)

WinMain( Win, Normal )

-- End combo.exw

For debugging purposes, I added a print at line 10174 of win32lib:
? hWnd

Whenever there's been an allocation or trace, hWnd will be 0.  According to
MS, this should only happen when the point is outside of the parent
specified in the call to ChildWindowFromPointEx.  That's clearly not what's
going on here, since the same point (0,0) is used successfully.  I haven't
noticed any other API calls that are as selective as these (maybe someone
else has), so I have no idea what the problem is.  Maybe someone (Rob?)
could try compiling the code to C to see if this still happens?  I'd try it,
but I don't have Watcom. :)

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu