On Sat, Jul 16, 2011 at 11:46 AM,  <[email protected]> wrote:

> My ProductView ResDialog has two dialogs in it - the Product View and also
> an About dialog.

> Now ResEdit generates unique numeric IDs for each dialog. However, in the .h
> file, the IDs for both dialogs are lumped together, and some have the same
> numeric ID.  (.rex, .rc and .h files sent on separate email with subject
> "Control does not get focus".)
>
> Will this potentially cause problems with the GlobalConstDir? (It doesn't
> seem to so far.)

It could, potentially, but the biggest problem would be having the
same symbolic ID, with different numeric IDs.  Having the same
symbolic ID with the same numeric ID in different dialogs is never a
problem.

Just think about how a .Directory object works and is used in this
case.  The index of the directory object is set to the symbolic ID and
the value at that index is set to the numeric value of the symbol.  If
you have two controls with the same symbolic name, when the second
symbolic name is added to the directory object, it will overwrite the
first.  If the numeric value is the same for both controls, it doesn't
make any difference.

If you are using a resource editor, this would be impossible to do.
The resource editor can't produce a symbolic ID with 2 different
values.  But, if you added some symbols to the directory object in
your program, you could potentially do it.

> I could of course ensure that each dialog has its own DLL.

I wouldn't do that, one of the benefits of using a resource DLL is to
have everything in one file.

The only time you are going to have a problem is if you are using
symbolic IDs for the indexes of a dialog data stem.  On return from
the dilaog, ooDialog attempts to set the indexes of the stem to the
'data' of the control.  But, at this point only the numeric id of the
controls is known.  So, ooDialog does a "reverse look up" in the
directory object.

Say you have a control with a resource ID of 718.  ooDialog will ask
the directory object for the "index" of 718.  If two indexes, i.e.,
two symbols have the value of 718, which index is returned is not
defined.  This will make your program a little flaky.  This is a
problem you will have in the situation you describe.  If you want to
use the dialog data stem, *and* use symbolic IDs for the indexes of
the stem, you *must* use unique numeric values.  This is easily
achieved by editing the .h file and changing any duplicate values to
unique values.

--
Mark Miesfeld

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to