URI comparison in C / Win32 API

Using

  <http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/shlwapi/path/urlcompare.asp>

in a C program

  #include <stdio.h>
  #include <stdlib.h>
  #include <shlwapi.h>
  #pragma comment(lib, "shlwapi.lib")
  
  int main(void)
  {
      LPCTSTR uri1 = "http://www.example.org/%61";
      LPCTSTR uri2 = "http://www.example.org/a";
  
      if (UrlCompare(uri1, uri2, FALSE) == 0)
      {
          printf("equal\n");
      }
      else
      {
          printf("not equal\n");
      }
  
      return EXIT_SUCCESS;
  }

prints "equal".

Received on Thursday, 26 December 2002 14:47:33 UTC