Click here to Skip to main content
15,886,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: In C, how to read data from a file Pin
Richard MacCutchan15-May-12 1:30
mveRichard MacCutchan15-May-12 1:30 
QuestionMultiprocessor sort and search in C? Pin
Simon Langdon14-May-12 23:28
Simon Langdon14-May-12 23:28 
AnswerRe: Multiprocessor sort and search in C? Pin
David Crow15-May-12 3:47
David Crow15-May-12 3:47 
AnswerRe: Multiprocessor sort and search in C? Pin
TomasRiker217-May-12 8:11
TomasRiker217-May-12 8:11 
QuestionMFC help : code error 0000007B Pin
jawadali47714-May-12 21:57
jawadali47714-May-12 21:57 
AnswerRe: MFC help : code error 0000007B Pin
enhzflep14-May-12 22:24
enhzflep14-May-12 22:24 
QuestionRe: MFC help : code error 0000007B Pin
CPallini14-May-12 22:27
mveCPallini14-May-12 22:27 
AnswerRe: MFC help : code error 0000007B Pin
jawadali47714-May-12 23:42
jawadali47714-May-12 23:42 
basically i have the console program running fine (means having source file and header files). than i wanted to build GUI for this using MFC in vs2008. now i don't understand how to open serial port in MFC. code below shows how to open serial port in console programming using cmd prompt.

C#
COMportName[0] = ' ';
     while (COMportName[0] == ' ') {
         printf("\nEnter the %s port number the PTU is attached to: ", COMportPrefix);
         scanf("%d", &COMportNum);
         printf("You selected %s%d. Is this OK? (enter 'y' or 'n'): ", COMportPrefix, COMportNum);
         tmpChar = 'f';
         while ( (tmpChar != 'y') && (tmpChar != 'n') )
               tmpChar = ((char) tolower(getchar()));
         if ( tmpChar == 'y' )
            sprintf(COMportName, "%s%d", COMportPrefix, COMportNum);
     }
     tmpChar = 'f';
     while (tmpChar != 'y') {
         printf("\nEnter the baud rate the ptu is communicate at (default: 9600): ");
         scanf("%d", &BaudRate);
         printf("You selected %d. Is this OK? (enter 'y' or 'n'): ", BaudRate);
         tmpChar = 'f';
         while ( (tmpChar != 'y') && (tmpChar != 'n') )
               tmpChar = ((char) tolower(getchar()));
     }


     /* initialize the serial port */
     set_baud_rate(BaudRate);
     COMstream = open_host_port(COMportName);

     if ( COMstream == PORT_NOT_OPENED )
         { printf("\nSerial Port setup error.\n");
           goto abnormal_exit;  }
     printf("\nSerial port %s initialized\n", COMportName);

GeneralRe: MFC help : code error 0000007B Pin
CPallini14-May-12 23:52
mveCPallini14-May-12 23:52 
GeneralRe: MFC help : code error 0000007B Pin
jawadali47716-May-12 19:14
jawadali47716-May-12 19:14 
GeneralRe: MFC help : code error 0000007B Pin
TinyDevices15-May-12 3:32
professionalTinyDevices15-May-12 3:32 
AnswerRe: MFC help : code error 0000007B Pin
Andy41114-May-12 22:49
Andy41114-May-12 22:49 
GeneralRe: MFC help : code error 0000007B Pin
CPallini14-May-12 23:09
mveCPallini14-May-12 23:09 
GeneralRe: MFC help : code error 0000007B Pin
Andy41114-May-12 23:18
Andy41114-May-12 23:18 
GeneralRe: MFC help : code error 0000007B Pin
jawadali47714-May-12 23:46
jawadali47714-May-12 23:46 
GeneralRe: MFC help : code error 0000007B Pin
Andy41114-May-12 23:59
Andy41114-May-12 23:59 
GeneralRe: MFC help : code error 0000007B Pin
David Crow15-May-12 3:52
David Crow15-May-12 3:52 
SuggestionRe: MFC help : code error 0000007B Pin
David Crow15-May-12 3:58
David Crow15-May-12 3:58 
AnswerRe: MFC help : code error 0000007B Pin
soaringpilot15-May-12 10:44
soaringpilot15-May-12 10:44 
GeneralRe: MFC help : code error 0000007B Pin
jawadali47716-May-12 19:19
jawadali47716-May-12 19:19 
GeneralRe: MFC help : code error 0000007B Pin
soaringpilot17-May-12 6:19
soaringpilot17-May-12 6:19 
QuestionResponding To Asynchronous Functions Pin
AmbiguousName14-May-12 20:38
AmbiguousName14-May-12 20:38 
AnswerRe: Responding To Asynchronous Functions Pin
CPallini14-May-12 22:08
mveCPallini14-May-12 22:08 
AnswerRe: Responding To Asynchronous Functions Pin
TinyDevices15-May-12 3:31
professionalTinyDevices15-May-12 3:31 
AnswerRe: Responding To Asynchronous Functions Pin
soaringpilot15-May-12 10:51
soaringpilot15-May-12 10:51 

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.