May 27th, 2024

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

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.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

3 comments

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

  • Ivan Kljajic

    They both live in the same .lib too

    • Antonio Rodríguez · Edited

      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…

  • Ian Boyd

    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.