Announcement

Collapse
No announcement yet.

PBres

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PBres

    Is there a limit to the size of file that PBres can deal with? I am getting the GPF box when I compile a slightly enlarged file that was OK yesterday - taking out the extra bits makes no difference now!!! The RC file is 97452 and it needs 1.55Mb BMP's. The last compiled PBR was 1394482 in size. Any thoughts please
    Iain Johnstone
    “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

  • #2
    Iain;

    While I am not sure if there is a limit to the size of a PB Resource file (I think there may be), you can easily get around any limit by breaking up your Resources into multiple Resource files (which is more efficient).

    While PB only allows ONE Resource file per EXE or DLL, you can use multiple DLLs as Libraries for Resources.

    For example, I could create 10 different Bitmap Libraries using 10 different DLLs, each with its own Resources in it.

    Then when a particular Library is needed simply use the API function LoadLibrary to load the Image Library and gets its Instance handle. With the handle you can use any of the API functions:

    LoadBitmap
    LoadImage
    LoadCursor
    LoadIcon


    to extract the necessary resources from the DLL.

    If the Library isn't needed then you can use the API function FreeLibrary to unload the DLL.

    By breaking up the Resources into multiple DLLs, you make your program more efficient. Also the main EXE will load faster and you only need to load a Library when the Resources are actually
    needed.



    ------------------
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

    Comment


    • #3
      lain,
      You may find the rsrc utility helpful. It will add a res file to
      an exe. No need for pbr's.

      www.jcfuller.com/rsrc.zip


      James


      ------------------


      [This message has been edited by jcfuller (edited April 20, 2000).]

      Comment


      • #4
        Thanks chaps - I have got round the problem temporarily by removing the bitmaps from the RC and loading them in from the main directory as discrete files - not what I really wanted. The DLL route is going to be the one to try!
        Thanks for your thoughts
        Iain Johnstone

        ------------------
        “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

        Comment


        • #5
          Originally posted by Iain Johnstone:
          The RC file is 97452 and it needs 1.55Mb BMP's. The last compiled PBR was 1394482 in size.
          As I remember, it's not possible to declare ASCIIZ more than approx 1350000-1400000 (GPF).
          Perhaps, these problems are linked.

          BMP-format is too fat. Could be it possible to convert to WMF or TIFF ?
          To show WMF is enough simple, using API; tiff - there is special DLL (iSource ?).

          [This message has been edited by Semen Matusovski (edited April 20, 2000).]

          Comment


          • #6
            I use RLE (Run Length Encoded) bitmaps in my applications, they can reduce bitmap size by as much as 70%+ in some cases

            In one app I had a 45k bitmap shrunk to only 4k! and the image didn't look any different.

            ------------------
            Kev G Peel
            KGP Software
            Bridgwater, UK.
            mailto:[email protected][email protected]</A>

            Comment


            • #7
              I have found the problem - one of the files was reported to be 67Mb, so I am not suprised that there was a problem. However, all the BMPs are now DLLs - should have done it ages ago but lacked the courage! This has reduced the EXE from 1.9Mb to 650K - must easy to distribute upgrades. Many thanks
              Iain Johnstone www.mstdrain.co.uk

              ------------------
              “None but those who have experienced them can conceive of the enticements of science” - Mary Shelley

              Comment

              Working...
              X