On Sun, Aug 7, 2011 at 9:04 AM, Oliver Sims
> In section 24.4.2 of the ooDialog Reference (7091), the first argument for
> the "new" method
> Is stated to be a filename.
> However, in my code, I use a blank - which works:
This is actually working as documented, but maybe the doc is unclear.
It says this for the second 'dlg' arg:
"The second optional dlg argument is a dialog object in the current
program. It specifies that the
module containing the resources that the ooDialog program wants to
access is one of the
modules already available to the program. That is, either the
oodialog.dll module, or the
module used for a ResDialog.
To specify the oodialog.dll module, the file name must be oodialog.dll
and the dialog object
can be any instantiated dialog in the current program."
So - you used the second arg, which specifies that the resources are
in either oodialog.dll, or in the DLL used for a ResDialog. Then, the
file name argument is not "oodialog.dll", so the DLL used for a
ResDialog is to be the module containing the resources.
Then the last note in the doc for the second arg says:
"To specify the module used with a ResDialog, the dialog object must
be the instantiated
ResDialog dialog object."
> resImage = .ResourceImage~new( "", self) -- Create
> an instance of a resource image
So, from the doc I know that the "self" arg above in your code is an
instance of a .ResDialog.
I guess to clarify the doc I could add that if the first argument is
not "oodialog.dll" case insensitive and the second arg is an instance
of a ResDialog, the first arg can be any string because its value is
Internally, if the string is not "oodialog.dll" and the second arg is
a ResDialog, then the DLL module is already loaded into the process
space and ooDialog doesn't need to know the name of the DLL, it
already has access to the handle of the module.
> image = resImage~getImage(IDB_PROD_ICON) -- Create
> an image from the Product bitmap
> stImage = self~newStatic(IDC_PRODABT_ICON_PLACE)~setImage(image) --
> Create a static text control and set the image in it
> Does the documentation need to be updated to allow for a null filename?
Maybe a note clarifying that "" is not equal to "oodialog.dll".
> (Btw, the first param is required, so
> resImage = .ResourceImage~new( , self)
> does not work.
Yes that was intentional at the time I coded it. But, in reviewing
the code and thinking about today, I could change that to make the
first argument optional. In which case the second argument would have
to be an instance of a .ResDialog.
This is the type of thing where I was hoping more users of ooDialog
would participate in these discussions so that the users could decide
what they would prefer in things like this.
For whatever reason, when I first coded it, it made more sense to me
to require the first arg. Now, today, allowing it to be optional
makes sense to me.
What do you think? The "you" is meant to be any of you reading this discussion.
By the way, in rereading this before I pushed send, I see that what I
probably meant the doc to read is this:
"To specify the oodialog.dll module, the file name must be
oodialog.dll and the dialog object
can be any instantiated dialog in the current program.
To specify the module used with a ResDialog, the dialog object must be
ResDialog dialog object and the file name can be any string."