Announcement

Collapse
No announcement yet.

PROGID$() function.

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

  • PROGID$() function.

    The PROGID$() function looks up a CLSID in the registry, and returns the associated ProgID, which is a human-readable name for it. COM has an absolute, unequivocal rule that a ProgID may be no longer than 39 characters. So, PowerBASIC scans 40 characters (the trailing nul) when making this conversion for you.

    Unfortunately, it seems a few folks now break this rule occasionally, and COM services do not enforce it in the registry, as they should. Luckily, it is extraordinarily rare. If you happen to encounter this issue, the only practical solution is to edit the ProgID in the registry to a conforming value. If help is needed, you may contact PowerBASIC Technical Support for assistance.

    We will break the rule, too, in the next version and support up to 95 characters, instead of 39.

    Best regards,

    Bob Zale
    PowerBASIC Inc.

  • #2
    We will break the rule, too, in the next version and support up to 95 characters, instead of 39.
    Bob, Not to argue with you about the reason why. But more to impress the point NOT break a given "Rule".

    Long since I first learned that MSCOMM was a POS, and PB correctly coded Serial Port routines ran circles around it, I have come to learn and hopefully behave under the "Rules" of coding, based on PB says its so, and M$ says its so, so I try to make it so.

    Just because a few broke the rules, does not mean PB should too to accommodate the ones that broke the rules. (Although I have no problem with PB stating certain things will not work with PB because of a rule broken)

    Although "Knowingly" I do not work with PROGID$() and CLSID ....."UnKnowingly" this may not be the case, and when bugs appear, its hard enough to track down if its my fault, or some code someone else wrote, much less if one of them "Broke the rules" but if 2 or more "Break the rules" I could really be stuck scratching my head with a concept of 2+2 = 4 so why is the result = 6?????

    (Bad example....but you get what I mean)

    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


    • #3
      Regrettably, one of the egregious rule-breakers is ms.

      Bob Zal
      PowerBASIC Inc.

      Comment


      • #4
        When the PowerBasic COM Browser gives the error message

        "Can't access object because it doesn't have a ProgID"

        Does this mean that the ProgID doesn't exist or does it mean that it is illegally long?

        The reason I ask is because the help file for PROGID$ function states:

        "A COM object/component must include an alphanumeric PROGID string in order to be used by PowerBASIC (and Visual Basic)."

        Visual Basic is quite happy to work with this object!

        If this problem is solved I can throw away my VB6 - at long last.

        -------------------------
        Added:

        Checked the tlb with Jose's browser - the tlb has no ProgId - this doesn't seem to worry Visual Basic, VBA or JavaScript

        Is it not possible for PowerBasic COM browser to ignore the fact that there is no ProgID ?

        The tlb was recently produced by Adobe (none of the previous versions dating back quite some time have ever had a ProgID)

        Bob
        Last edited by Robert Wallace; 17 Mar 2008, 07:42 AM. Reason: Extra info

        Comment


        • #5
          When the PowerBasic COM Browser gives the error message

          "Can't access object because it doesn't have a ProgID"

          Does this mean that the ProgID doesn't exist or does it mean that it is illegally long?
          It means that there is not a ProgID for it in the registry.

          The reason I ask is because the help file for PROGID$ function states:

          "A COM object/component must include an alphanumeric PROGID string in order to be used by PowerBASIC (and Visual Basic)."

          Visual Basic is quite happy to work with this object!

          If this problem is solved I can throw away my VB6 - at long last.
          Not having a ProgID only means that you can't create an instance of the object using [LET] objvar = NEW {DISPATCH | InterfaceName} {ON} {ProgramID$}, but there is another way.
          Forum: http://www.jose.it-berater.org/smfforum/index.php

          Comment


          • #6
            Bob--

            One possibility would be to create your own ProgID entry in the registry. You could also generate the object by brute force, but I think this would be better for future compatibility. I'll see if we can post an example. Stay tuned.

            Exactly which object is it that's causing you a problem?

            Bob Zale
            PowerBASIC Inc.

            Comment


            • #7
              "Resources for Visual Basic.tlb"

              Adobe Indesign CS3

              Bob

              Comment

              Working...
              X