Announcement

Collapse
No announcement yet.

Detemine PB Version from Bas or Exe

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

  • Detemine PB Version from Bas or Exe

    I'm still stumbling around PB (and enjoying every minute of it) with great assistance from this forum.
    I had PB8 manipulating MSWord, but have had no luck with PB9 and MSWord as yet.
    There is a lot of sample code, most of which seems to come from a PB8 background.
    Even when compiling the Word sample distributed with PB9 I get the message Error 408 ..... Wrong compiler for this program.

    Experimenting with PB8 samples and with the other samples from forum posts, they all fail at different points using PB9, but many of them fine run under PB8.

    Is there a way of looking at the sample code (or exe) and ascertaining whether it originated from PB9?

    I suspect my problems are mostly with the word.inc files, but I've created new inc files (Word 2002) but these still don't compile.
    I freely admit that the problem is my lack of knowledge about PB, and COM in particular.
    Come to think of it, I didn't have much knowledge of VB COM either, but seemed to muddle along despite all the dependencies.

    Any help much appreciated.

    Ian Bayly

  • #2
    Hi Ian--

    Check your source programs for a #COMPILER meta-statement. This is used to specify the the compiler and possibly the version for which the program was designed. It could be that a particular source program was designed for our Console Compiler, and you're using PB/WIN. Or it could be a specific version which was specified. If #COMPILER PBWIN 8 is specified, and you try to compile using PB/Win 9, an error 408 will be generated. In most cases, you can just change it to PBWIN 9 and all will likely be fine. Most code is upward compatible, or at worst, small changes may be needed.

    Check out #COMPILER in your help file for a full description.

    Best regards,

    Bob Zale
    PowerBASIC Inc.

    Comment


    • #3
      Thanks Bob

      The pointer helped.

      Regards

      Ian B

      Comment


      • #4
        Is there a way of looking at the sample code (or exe) and ascertaining whether it originated from PB9?
        A long time ago I posted this...

        This whine's time has come

        ... as a 'suggestion' for those who post to the source code forum. I think it's still valid.

        However, since version 4x/8x the #COMPILER directive has been available, so if you are posting something which relies on features or behavior only available in 8+ or 9+, a #COMPILER directive would probably be a good idea as well.

        (I got myself a "wrong compiler for this program" compile-time error myself last week).

        MCM
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Also FWIW, there's no reason you can't include a "Compiler" string in your program resource... then the version will be visible when you look at the "properties" of the compiled EXE via Explorer...

          e.g (I don't do this but here is how it could be done)...

          Code:
          // STANDARD VERSION RESOURCE
          
          VS_VERSION_INFO VERSIONINFO
          FILEVERSION      VERSION_MAJOR, VERSION_MINOR, 0, VERSION_BUILD
          PRODUCTVERSION   VERSION_MAJOR, VERSION_MINOR, 0, VERSION_BUILD
          FILEOS VOS_WINDOWS32
          FILETYPE VFT_APP
          //* VFT_DLL FOR DLLs
          BEGIN
            BLOCK "StringFileInfo"
            BEGIN
              BLOCK "040904E4"
              BEGIN
                VALUE "CompanyName",      "Tal Systems Inc.\0"
                VALUE "FileDescription",  VERSION_DESC
                VALUE "FileVersion",      VERSION_LITERAL
                VALUE "InternalName",     "tsjmaintr\0"
                VALUE "OriginalFilename", "tsjmaintr\0"
                VALUE "LegalCopyright",   VERSION_COPYRIGHT
                VALUE "LegalTrademarks",  VERSION_TRADEMARK
                VALUE "ProductName",      VERSION_PRODUCT
                VALUE "ProductVersion",   VERSION_LITERAL
                VALUE "Comments",         "none\0"
             VALUE "Compiler",           "PB for Windows 9.0\0"
                VALUE "Author",           "Michael C. Mattias Racine WI USA\0"
                VALUE "VersionDate",       VERSION_DATE
              END
            END
          END
          MCM
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            I just tried it myself.

            Works like a Champ!!!! (At least in the program properties)
            Does not appear in Explorer popup if you hover over the program though (but may be because of some other setting)
            Engineer's Motto: If it aint broke take it apart and fix it

            "If at 1st you don't succeed... call it version 1.0"

            "Half of Programming is coding"....."The other 90% is DEBUGGING"

            "Document my code????" .... "WHYYY??? do you think they call it CODE? "

            Comment


            • #7
              Does not appear in Explorer popup if you hover over the program though (but may be because of some other setting)
              That other setting is called "Here is how that works." Explorer only looks for a fixed set of string resource literals.

              Complaints?
              ==>
              Code:
              Microsoft Corporation
              One Microsoft Way
              Redmond WA 98052-6399
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                MCM
                I figured that was the case and by default only a limited set.
                (override on users settings?? maybe...but not researched)
                (but then that would involve overriding users use to make mine better (like many companies do) and I do NOT like that)

                Properties example was more than enough to show how easy to show a difference in compilers
                Engineer's Motto: If it aint broke take it apart and fix it

                "If at 1st you don't succeed... call it version 1.0"

                "Half of Programming is coding"....."The other 90% is DEBUGGING"

                "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                Comment


                • #9
                  There "may" be some registry setting you can hack or maybe a "tweakui" program which would enable explorer to put other string resources into Explorer's tooltip.

                  Or maybe Explorer would support some kind of "plug-in" (???).

                  Frankly I can't see where the "compiler" user-defined string resource is important enough to show on the tooltip. Heck, just right-click, click properties, click version tab and you have it.
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment

                  Working...
                  X