On Thu, Feb 14, 2013 at 11:03 AM, Art Heimsoth <artstore@artheimsoth.com> wrote:
> On Thu, Feb 14, 2013 at 8:07 AM, Art Heimsoth
> <artstore@artheimsoth.com> wrote:
>
 
> Your best bet would be to compile a resource only DLL and bind the
> icon to that.  Then use that DLL as the icon file name with the
> index you use for the icon resource.
 
Are there advantages to incorporate all the resources currently defined
in the .rc file and build it all into a dll and switch to use the ResDialog
with this icon resource also included?  


Yes, I think there are definite advantages, especially if you are distributing an "application" that is more than the simple examples we send with ooDialog.

* Even if you are using .rc files instead of a UserDialog, ooDialog still has to parse the .rc file and construct an in-memory dialog template.  If you have other resources like bitmaps and icons, the image files have to be loaded from disk and converted into in-memory structures.  Once that is done, then ooDialog can start the underlying dialog.  

With a DLL all of that is done ahead of time.  The operating system can load a DLL very fast, and then ooDialog can start the dialog.

You wouldn't be able to see any difference to the eye, unless you had a really hugh ooDialog application, but using a ResDialog is much faster than using a RcDialog.

* If you have a number of bitmaps, menus, icons, *.rc files, once you compile it into a DLL you only have 1 file to manage.

I myself would always use a ResDialog.  But, for showing examples to other people, it is easy for the "other" people if they have text files they can look at.

I guess really the biggest advantage is scaling.  Using text .rc files and including *.bmp, *.ico files is fine and simple for small example programs.  But that technique does not scale well.

 
Would I still need the .h file to
continue to use symbolic IDs?  

You do.  The .h file is needed to feed to the compiler.  And it is then also needed for your Rexx code to translate the symbols to numbers.  The .h file needs to be 'inlcuded' in the .rc file, or the rc compiler won't be able to compile the .rc script.  Look at some of the .rc files included with the examples, you will see something similar to:

#include "ApplicationIcon.h"

in them.  The actual *.h file is the one that has the symbol defines that both the rc compiler and your Rexx program needs and uses.
 
I suppose it is too much to ask if there
is a simple example available on how to put this all together?

In the extra examples package that you can download from SourceForge from the ooDialog section, there is a makeDLL.rex program and a read me for it that can help.  With the makeDLL.rex program, you can recompile the resource only DLLs that are used for some of the example programs in the extra examples package.  The read me walks you through the process.

I believed at the time I wrote the read me that it would be a sufficiently simple example to show people how to put this all together.

However, since I've had a lot of disparaging comments on my documentation skills, I'm not sure if it is sufficient.  It should be close to sufficient.  ;-)  I'll give you help if you get stuck anywhere.  Also, I know that Oliver did not know how to compile a resource only DLL when he started writing the user guide, and he does now.  I'm sure he can help also.
 
--
Mark Miesfeld