Click here to Skip to main content
15,881,381 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCMFCRibbonComboBox Pin
Member 1325158811-Jan-21 16:31
Member 1325158811-Jan-21 16:31 
AnswerRe: CMFCRibbonComboBox Pin
Richard MacCutchan11-Jan-21 22:39
mveRichard MacCutchan11-Jan-21 22:39 
GeneralRe: CMFCRibbonComboBox Pin
Member 1325158812-Jan-21 9:18
Member 1325158812-Jan-21 9:18 
GeneralRe: CMFCRibbonComboBox Pin
Victor Nijegorodov12-Jan-21 10:12
Victor Nijegorodov12-Jan-21 10:12 
GeneralRe: CMFCRibbonComboBox Pin
Member 1325158812-Jan-21 16:23
Member 1325158812-Jan-21 16:23 
GeneralRe: CMFCRibbonComboBox Pin
Victor Nijegorodov12-Jan-21 21:07
Victor Nijegorodov12-Jan-21 21:07 
GeneralRe: CMFCRibbonComboBox Pin
Richard MacCutchan12-Jan-21 21:24
mveRichard MacCutchan12-Jan-21 21:24 
QuestionC Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill11-Jan-21 10:49
jackngill11-Jan-21 10:49 
Sorry for the cryptic nature of this question just trying to condense as much as I can.

I am trying to write a program in "C" which has a twist on the normal echo command in XPSP3
XP echo does not allow you to remove EOL characters when you redirect into text file with the >
I think they call it CRLF. However in my wanderings I have come across some "C" code that I think could compile a useful program. Here is some background info to illustrate:
The program that I hope to use would be called ECO.COM would be commandline for usage in CMD
ECO would be furnished with a flag (-X) that would give the user the choice to include the CRLF removal or would just be used just like echo command in XP without the -X flag. The ECO.COM file would be restricted to one line (80 Chars) long so the following could take place. The user could type for example
ECO.COM -X SET VARIABLE= (the ECO.COM would have with the -X flag to strip out the end CRLF so once the
SET VARIABLE= line was ridected to text file could easily be appended (>>) with a second ECO command or text file all on the same line. The resultant Text file could then be renamed to a .CMD file & called from another batch file thus setting the given %Variable%
I think they call it backticks or command substitution or some call it back quotes anyway here is the code which I have sought & tried to compile to create ECO.COM/EXE but it is not working can someone assist to make it work Please I think it would be very useful alternative to SET/P option in XPCMD?Thumbs Up | :thumbsup:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

       /* setting flag to remove crlf */
int main()
{
for (i = 1; i < argc; i++) {

            /* Check for a switch (leading "-"). */

        if (argv[i][0] == '-') {

            /* Use the next character to decide what to do. */

            switch (argv[i][1]) {

                case 'x':
                        printf("flag a was called\n");
                        break;

        }
    }
}

        /* part of script that echos 80 chars on one line */

int echo()
{
    char input[80];
    while(fgets(input, 80, STDIN)){  //read from STDIN (aka command-line)
        printf("%s\n", input);  //print out what user typed in
        memset(input, 0, strlen(input));  //reset string to all 0's

    return 1;
}

        /*  go to exit if the user enters -x flag */

      if (*char == -x) {
         goto remit;

      else

      if (*char == " ") {
         goto exit;
}
             /* remove carriage returns from one line /*


         remit;
int main()
{
    const char *remove_any_of = "\n\r";
    int c;
    while((c = getchar()) != EOF) {
        if (!strchr(remove_any_of, c)) putchar(c);

         exit;

    return 0;
}


Best Regards
JacknGill Big Grin | :-D

modified 12-Jan-21 15:57pm.

QuestionRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
David Crow11-Jan-21 16:36
David Crow11-Jan-21 16:36 
AnswerRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill11-Jan-21 22:25
jackngill11-Jan-21 22:25 
AnswerRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
Richard MacCutchan11-Jan-21 22:36
mveRichard MacCutchan11-Jan-21 22:36 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill11-Jan-21 22:58
jackngill11-Jan-21 22:58 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
Richard MacCutchan11-Jan-21 23:09
mveRichard MacCutchan11-Jan-21 23:09 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill11-Jan-21 23:15
jackngill11-Jan-21 23:15 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
Richard MacCutchan11-Jan-21 23:55
mveRichard MacCutchan11-Jan-21 23:55 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill12-Jan-21 9:46
jackngill12-Jan-21 9:46 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
Richard MacCutchan12-Jan-21 21:32
mveRichard MacCutchan12-Jan-21 21:32 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill13-Jan-21 5:24
jackngill13-Jan-21 5:24 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
Richard MacCutchan13-Jan-21 1:50
mveRichard MacCutchan13-Jan-21 1:50 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill13-Jan-21 5:26
jackngill13-Jan-21 5:26 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
Richard MacCutchan13-Jan-21 5:36
mveRichard MacCutchan13-Jan-21 5:36 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill14-Jan-21 12:04
jackngill14-Jan-21 12:04 
GeneralRe: C Programming code to build an echo varient that hopefully can be used in WinXP Pin
jackngill15-Jan-21 23:59
jackngill15-Jan-21 23:59 
QuestionMFC: Most recently used (MRU) files Pin
Member 1325158810-Jan-21 18:18
Member 1325158810-Jan-21 18:18 
AnswerRe: MFC: Most recently used (MRU) files Pin
Victor Nijegorodov10-Jan-21 21:28
Victor Nijegorodov10-Jan-21 21:28 

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.