[Fwd: RE: [ros-kernel] Hunting a task]
Waldo Alvarez Cañizares - another buried alive
wac at ghost.matcom.uh.cu
Wed Oct 22 14:15:53 CEST 2003
Hi again:
Comments follow
On Tue, 21 Oct 2003, Thomas Weidenmueller wrote:
> Vizzini wrote:
>
> >Skywing cannot post atm so this is from him.
> >
> >-----Forwarded Message-----
> >From: Skywing <skywing at valhallalegends.com>
> >To: Vizzini <vizzini at plasmic.com>
> >Subject: RE: [ros-kernel] Hunting a task
> >Date: Tue, 21 Oct 2003 14:30:39 -0500
> >
> >I myself have written code that will break if MessageBox is not implemented
> >with dialog boxes. I've seen discussion on the Microsoft programming
> >newsgroups where other people have done the same thing, too. Furthermore,
> >the Platform SDK even says that MessageBox uses dialog boxes.
> >
> >"lpCaption
> >[in] Pointer to a null-terminated string that contains the dialog box title.
> >If this parameter is NULL, the default title Error is used.
> >uType
> >[in] Specifies the contents and behavior of the dialog box. This parameter
> >can be a combination of flags from the following groups of flags." -
> >MessageBox documentation.
> >
> >Also, the MessageBox family of functions is organized under the "Dialog
> >Boxes" section in the Platform SDK.
> >
> >All of these factors lead me to believe that changing this behavior is
> >dangerous and will break compatibility.
> >
> >Note that creating dialog boxes with dynamic control sets/positions is
> >possible through using DialogBoxIndirectParam/CreateDialogBoxIndirectParam
> >and modifying the dialog template before using it to create the dialog. I
> >believe that this is in fact what the Microsoft implementation of MessageBox
> >does.
> >
Well I don't think an application will try to modify a messagebox but OK
just in case let's leave it like dialog boxes. However I think that
creating a dynamic template in memory to then parse it is like going back
to go forward. Actually that was the first thing that came to my mind when
you said that it must be a dialog, but I beleive that just creating
windows
(and its child controls) with the
structures that use dialogs will work fine. At the end the result will be
the same, you will be able to use dialog functions as it will be a dialog
doesn't matter how it was created, the final result will be the same. It
will be a lot less code (easier to understand) and will be faster because
it
will involve less copy of strings in memory and will prevent some memory
allocations too wich will prevent possible memory leaks. Something against
this?
> >
> That's the latest implementation of MessageBoxes in ReactOS, except that
> ansi messages for some reason don't work (Small bug i believe)
Mine is not like that. Seems that I'll have to download the snapshot
again. Maybe the reimplementation as I say takes away the bug. I will
check and test it.
>
> >-----Original Message-----
> >From: ros-kernel-bounces at reactos.com [mailto:ros-kernel-bounces at reactos.com]
> >On Behalf Of Waldo Alvarez Cañizares - another buried alive
> >Sent: Tuesday, October 21, 2003 10:07 AM
> >To: ReactOS Kernel List
> >Subject: Re: [ros-kernel] Hunting a task
> >
> >Hi ppl:
> >
> >
> >
> >>>- Get ansi MessageBox working (user32.dll)
> >>>
> >>>
> >>Seems easier. I think i can handle this, but i will only do it if nobody
> >>is working there.
> >>
> >>
> >>
> >
> >
> >
> go ahead ;)
I'm on it :)
>
> >I was taking a look to MessageBox. Seems to me that it is quite complete
> >with some small things to do. But i saw that a messagebox is implemented
> >as a dialog. This seems incorrect to me.
> >
> >1- The window size for it is unknown when you create it (depends on
> >factors as the text lenght)
> >
> >2- You don't know the buttons it contains until you create it.
> >
> >3- You don't know if it has an icon until you create it. (current
> >implementation will contain a dummy static control)
> >
> >
> The latest implementation calculates everything before actually passing
> the dialog template with it's control to DialogBoxIndirectParam()
>
> >4- And the worst. What if the system is unable to load resources and you
> >want to display an error using a messagebox?
> >
> >
> I doubt windows can even handle this case, I mean win32k needs memory,
> etc...
Is not about memory, is about for example hard disk failure or network
failure (Ros could be booted across a network some day). OR simply the
part of the resources in the file damaged. The problem is
that strings for message boxes will be moved some day to resources going
for the internationalization. I was thinking that maybe caching it somehow
or at least putting them inside a .h file in order to make
internationalization easier.
>
> >So actually you almost don't know anything until it is created.
> >
> >That's why I think that everything should be created when the function is
> >called. Somebody against it. If you do please explain. Because I'm about
> >to change it.
> >
> >
> I agree, already done :)
>
Best Regards
Waldo
More information about the Ros-kernel
mailing list