the "if" function and using with extensions

Posted on 2006-03-19
Last Modified: 2013-11-20
My main motive for my application is to determine the file extension and then move onto that peice of code.I am still prety new to MFC C++ so give me a break if im doing it the hard way!

  AfxBeginThread(ReadAFS, this);

now when i have that function under one of my buttons it is supposd to pass onto another peice of code.but it does work, but if the extension was lower case then it totally screw's up.i have tried to go to my edit box and set the casing to upper and tried lower as well. and still same issue.
my main goal is to not worry bout extension casing.
Question by:didifool213
    LVL 49

    Accepted Solution

    I'm assuming that m_ext is a Cstring.

    There are several ways to compare strings that may have different character cases.  This simplest is to upshift one and compare to the upshifted copy of the other:

            MakeUpper( m_ext );
            if ( m_ext  == "AFS" ) {

    Another way is to use CString::CompareNoCase.  For instace:

            if ( m_ext.CompareNoCase("AFS") == 0 )  {
    LVL 1

    Author Comment

    Thanks!! it works!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now