Blogger Widgets
  • Sharing Photos using SignalR
  • TFS Extenstion - allows copy work items between projects
  • Displaying jquery progressbar with ajax call on a modal dialog
  • Managing windows services of a server via a website
  • Exploring technologies available to date. TechCipher is one place that any professional would like to visit, either to get an overview or to have better understanding.

Search This Blog

Tuesday, 23 November 2010

Filename validation in VC++

Validating files names should not be very difficult, Is it? . Yes, it is if you trying to do in VC++. Here is a small snippet of code that helps :-

CString fileName = "test:11";
for (int i = 0; i < fileName.GetLength(); i++)
{
 if (!(PathGetCharType(fileName[i]) & GCT_LFNCHAR)) 
 {
  bValid = FALSE;
  break;
 }
}
Do not forget to include "Shlwapi.h"

“If people never did silly things, nothing intelligent would ever get done.”
– Ludwig Wittgenstein

0 comments:

Post a Comment

Copyright © 2013 Template Doctor . Designed by Malith Madushanka - Cool Blogger Tutorials | Code by CBT | Images by by HQ Wallpapers