Click here to Skip to main content
15,913,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionmousePress crash 64 bit mfc application Pin
appollosputnik3-Apr-12 8:11
appollosputnik3-Apr-12 8:11 
QuestionSocket Alive Pin
john56323-Apr-12 2:20
john56323-Apr-12 2:20 
QuestionRe: Socket Alive Pin
Code-o-mat3-Apr-12 4:51
Code-o-mat3-Apr-12 4:51 
AnswerRe: Socket Alive Pin
Richard Andrew x643-Apr-12 5:14
professionalRichard Andrew x643-Apr-12 5:14 
AnswerRe: Socket Alive Pin
jschell3-Apr-12 8:41
jschell3-Apr-12 8:41 
QuestionIOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer2-Apr-12 21:47
VCProgrammer2-Apr-12 21:47 
AnswerRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Jochen Arndt2-Apr-12 23:36
professionalJochen Arndt2-Apr-12 23:36 
AnswerRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Richard MacCutchan2-Apr-12 23:44
mveRichard MacCutchan2-Apr-12 23:44 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 0:00
VCProgrammer3-Apr-12 0:00 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Richard MacCutchan3-Apr-12 0:19
mveRichard MacCutchan3-Apr-12 0:19 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 0:22
VCProgrammer3-Apr-12 0:22 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Richard MacCutchan3-Apr-12 0:34
mveRichard MacCutchan3-Apr-12 0:34 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 0:37
VCProgrammer3-Apr-12 0:37 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Richard MacCutchan3-Apr-12 0:44
mveRichard MacCutchan3-Apr-12 0:44 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Jochen Arndt3-Apr-12 0:47
professionalJochen Arndt3-Apr-12 0:47 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 0:52
VCProgrammer3-Apr-12 0:52 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Jochen Arndt3-Apr-12 0:59
professionalJochen Arndt3-Apr-12 0:59 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 1:02
VCProgrammer3-Apr-12 1:02 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Jochen Arndt3-Apr-12 1:12
professionalJochen Arndt3-Apr-12 1:12 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 1:17
VCProgrammer3-Apr-12 1:17 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
Jochen Arndt3-Apr-12 1:31
professionalJochen Arndt3-Apr-12 1:31 
GeneralRe: IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns error code 87 INVALID_PARAMETER Pin
VCProgrammer3-Apr-12 2:47
VCProgrammer3-Apr-12 2:47 
QuestionDuplicate Function - Linker Error LNK2005 Pin
Mike Certini2-Apr-12 9:30
Mike Certini2-Apr-12 9:30 
QuestionRe: Duplicate Function - Linker Error LNK2005 Pin
Richard MacCutchan2-Apr-12 21:25
mveRichard MacCutchan2-Apr-12 21:25 
QuestionCCommandLineInfo and parsing command line arguments. Pin
Maximilien2-Apr-12 3:47
Maximilien2-Apr-12 3:47 
I'm trying to understand how this thing works.

I have an application that can receive filename arguments like :

(A)app.exe file.txt /myFlag anotherfile.txt


file.txt will be loaded and anotherfile.txt will be used after the file (file.txt) is loaded.

or

(B)app.exe /myFlag anotherfile.txt


no file will be loaded but anotherfile.txt will be used nonetheless.

when parsing the command line arguments with the CCommandLineInfo class I get (probably good result) weird result.

The member CCommandLineInfo::m_strFileName is (according to MSDN) :

Stores the value of the first non-flag parameter on the command line.


In example A, m_strFileName is "file.txt" and in example B m_strFileName is "anotherfile.txt" ???

in example B, I don't have a non-flag parameter; but the m_strFileName is assigned to the parameter of the flag (anotherfile.txt).

code:
C++
void MyCommandLineInfo::ParseParam(const char* pszParam, BOOL bFlag, BOOL bLast)
{

    if ( bFlag )
    {
        if (_stricmp(pszParam,"myFlag") == 0)
        {
            m_FlagFound = true;
            m_ExpectFileNext = true;
        }

    }
    else
    {
        if ( m_ExpectFileNext)
        {
            m_MyFile = pszParam;
            m_ExpectFileNext = false;
        }
    }

    //call standard commandline processing (for /Regserver, Unregserver...)
    CCommandLineInfo::ParseParam( pszParam, bFlag, bLast );
}


Question :
In the B case, is there a way to have CCommandLineInfo not have m_strFileName be assigned like it should not be since there is no non-flag argument to my commandline.

Thanks.

Max.
Watched code never compiles.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.