Is there any difference between String­From­IID and String­From­CLSID?

Raymond Chen

Some time ago, I displayed in tabular form the difference between Uuid­To­String String­From­CLSID, String­From­IID, String­From­GUID2. But the entries for String­From­CLSID and String­From­IID are identical. So what’s the difference between those two?

There’s no difference. The two functions are functionally identical.

So why have two functions that do the same thing?

Probably just to provide counterparts to their buddies IID­From­String and CLSID­From­String, which do behave differently, because CLSID­From­String also supports ProgIds.

3 comments

Discussion is closed. Login to edit/delete existing comments.

  • Ian Boyd 1

    Yeah, the day i learned that

    CLSID­From­String("M");

    not only succeeds, but returns a valid CLSID

    {4ED063C9-4A0B-4B44-A9DC-23AFF424A0D3}

    was surreal.

  • Ivan Kljajic 0

    They both live in the same .lib too

    • Antonio Rodríguez 0

      Probably one is an alias or a wrapper of the other. In that case you could say that not only that they behave the same, but that they are the same function.

      In any case, you should call the correct only, if only for code legibility. Unless you are writing an entry for the Obfuscated C Contest or something like that…

Feedback usabilla icon