Announcement

Collapse
No announcement yet.

Compiling 16 bit with PBDLL16

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

  • Compiling 16 bit with PBDLL16

    I hope I'm not posting a dumb question, but I have been trying
    to compile a 16 bit program to run on an old laptop I have. It's
    a toshiba 486 running WFW 3.11.

    Anyhow I downloaded a sample program (DGTLCLK.ZIP) from the 16
    bit area and the progrma runs fine on the laptop. Now, if I
    recompile the program using PBDLL16 and then RC the file my
    laptop reports that I need a newer version of Windows.

    I started out with PBDLL60 and PBCC20, and I've been able to
    figure things out via the help files and so on, but the
    documentation for PBDLL16 is a bit weak on answering my above
    question.

    Tips, suggestions are most welcomed!

    TIA

    Larry

  • #2
    The problem is that by default, the Resource Compiler (RC.EXE) marks the application as needing Windows Version4 (Win95) or better!

    Either compile/link the .RC file from the command-line and specify the -31 parameter, or you can "patch" the EXE file after compilation.

    I wrote a little (32-bit) utility to do this by drag/drop the 16-bit EXE on to the utility EXE, or by running it from the command-line:
    Code:
    '------------------------------------------------------------------------------
    '     FIX311 - Patch Win3.1x EXE's for version 3.10 rather than 4.00
    '              Updates 16-bit EXE's created with PB/DLL 1.x and 2.x
    '
    ' * Requires 32-bit PB/DLL to compile this code, but should translate to 16-bit 
    '   very easily.
    '------------------------------------------------------------------------------
     
    #COMPILE EXE
    #DIM ALL
    #OPTION VERSION4
    #INCLUDE "WIN32API.INC"
     
    FUNCTION PBMAIN
        DIM szAppName   AS ASCIIZ * 260, A$
     
        szAppName = TRIM$(UCASE$(COMMAND$),CHR$(34))
     
        IF LEN(DIR$(szAppName,22)) THEN
            OPEN szAppName FOR BINARY AS #1 BASE = 1
            SEEK #1, &HCF
            GET$ #1, 2, a$
            IF A$ = CHR$(0,4) THEN
                A$ = CHR$(10,3) ' 3.10
                SEEK #1, &hCF
                PUT$ #1, a$
                MSGBOX "Version set to " + FORMAT$(ASC(a$,2)) + _
                       "." + FORMAT$(ASC(a$,1)),%MB_ICONINFORMATION, _
                       szAppName
            ELSE
                IF a$ = CHR$(0,0) THEN
                    MSGBOX "File does not appear to be a Win-16 app?", _
                           %MB_ICONERROR, szAppName
                ELSE
                    MSGBOX "Version already set to " + FORMAT$(ASC(a$,2)) + _
                           "." + FORMAT$(ASC(a$,1)), %MB_ICONSTOP, szAppName
                END IF
            END IF
            CLOSE #1
        ELSE
            MSGBOX "EXE file not found!"
        END IF
     
    END FUNCTION
    '-----------------------------------------------------------------------------

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      We had a problem with PB/DLL20, it needs about 6 add. dll's to run under w31
      We simply bought PB/DLL15 wich didn't had this problem.

      If you have installed office for w31 you have no problem.
      (Or redistribute the DLL's yourself)


      ------------------
      hellobasic

      Comment


      • #4
        Oops, misread, it's about RC only


        ------------------
        hellobasic

        Comment


        • #5
          Edwin is referring to the Win3.x OLE DLL's.

          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            Originally posted by Lance Edmonds:
            Edwin is referring to the Win3.x OLE DLL's.

            Well, I forgot to mention that I discovered the -31 switch in
            RC16. When I use either of these switches the program errors
            out requiring about five different dll's. Not having the Win3.x
            versions I tried copying my Win2000 versions and the program
            doesn't error, but it doesn't run either.

            Edwin mentioned RC v1.5, I suppose the sample .exe was compiled
            using this version? The problem is that I don't have the
            correct dll's and I'd really prefer not to have to add them
            anyway as the poor old laptop has a small hard drive.

            Anyhow, if using the 1.5 version will simplify things then I'd
            like to know if it's still available. And if so, how much.
            (It's beginning to look like it's time to retire this laptop...)

            Thanks guys!

            Larry

            Comment


            • #7
              Let's start over..

              You where talking about the resource compiler.
              I was about running a PB/DLL20 exe in w31.
              PB/DLL20 does not run on w31 unless you have installed a few DLL's
              Office 4.3 does install these DLL's (e.o.)

              PB/DLL15 was very cheap to get for us.
              I only used it for CDROM start.
              It could install these DLL's on load of course.

              That was my main problem, the CDROM SETUP.

              So, i'm not talking about RC.
              -31 would do fine i believe.

              BTW, i have a small setup to get those DLL's.


              ------------------
              hellobasic

              Comment


              • #8
                PB/DLL 1.x has long since been discontinued. As Edwin noted, the OLE DLL's are all that is needed for PB/DLL 2.0 apps to run in 16-bit Windows. The DLL's could be downloaded from the MS site for free, but we'll have to investigate and see if we can find a link for them.

                ------------------
                Lance
                PowerBASIC Support
                mailto:[email protected][email protected]</A>
                Lance
                mailto:[email protected]

                Comment


                • #9
                  Going through my archives, the necessary file appears to be called WW1116.EXE (OLE 2.03 update for Win3.x).

                  However, MS do not make this available anymore, so you'll have to search the Net for it... most good FTP or Archie agents should be able to track it down for you.

                  ------------------
                  Lance
                  PowerBASIC Support
                  mailto:[email protected][email protected]</A>
                  Lance
                  mailto:[email protected]

                  Comment


                  • #10
                    Also, I found references to the file WW0532.EXE as a possible source of the OLE DLL's.

                    A site that briefly describes a selection the older MSFILES library can be found at http://www.isomedia.com/homes/ftp_ht...soft/msref.htm

                    ------------------
                    Lance
                    PowerBASIC Support
                    mailto:[email protected][email protected]</A>
                    Lance
                    mailto:[email protected]

                    Comment


                    • #11
                      The file you need is called WW1116.EXE and is available from:
                      http://www.microsoft.com/
                      Select Downloads. On the download page, check keyword search for ww1116.exe for O/S Win 3.1

                      I needed it for the same reason. It contains all the OLE stuff necessary.

                      regards,


                      [This message has been edited by Ian Cairns (edited March 03, 2001).]
                      :) IRC :)

                      Comment


                      • #12
                        I copied the link:
                        http://download.microsoft.com/downlo...-US/ww1116.exe


                        ------------------
                        hellobasic

                        Comment


                        • #13
                          Thanks Everyone! I'm now up and running at 25mhz speeds...

                          Boy I've really forgotten how fast these pentiums are. FWIW,
                          I'm writing a CallerId program for the old laptop and I'm going
                          to behead the display and hang it on a wall linking it with a
                          homemade cable to the laptop. I bet I'm the only one running
                          a color caller id!

                          Now it's time to actually write the code for this ****er...

                          Thanks again!

                          Larry

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

                          Comment

                          Working...
                          X