Click here to Skip to main content
15,921,643 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: User previleges to create files in "C:\ProgramFiles" Pin
tgprakash29-Oct-04 19:48
tgprakash29-Oct-04 19:48 
GeneralHebrew Localisation Pin
Sitaram Sukumar29-Oct-04 0:03
Sitaram Sukumar29-Oct-04 0:03 
Generalreturning a function pointer from a function Pin
_psh_28-Oct-04 23:57
_psh_28-Oct-04 23:57 
GeneralRe: returning a function pointer from a function Pin
jan larsen29-Oct-04 0:19
jan larsen29-Oct-04 0:19 
GeneralSNTP server Pin
Anonymous28-Oct-04 23:36
Anonymous28-Oct-04 23:36 
GeneralRe: SNTP server Pin
Antony M Kancidrowski29-Oct-04 5:39
Antony M Kancidrowski29-Oct-04 5:39 
Questionhow to read data (serial communication) Pin
vc-programmer-28-Oct-04 23:35
vc-programmer-28-Oct-04 23:35 
AnswerRe: how to read data (serial communication) Pin
jan larsen29-Oct-04 0:10
jan larsen29-Oct-04 0:10 
How about doing it simple to start with?, all that overlapped functionality and error handling is great when you know what's going on, but for starters you should keep things simple.

(The code below is from memory and not debugged)

#define MAX_BUFFER 1024

int main()
{
   char      portName[] = "COM1";
   char      buffer[MAX_BUFFER];
   HANDLE    hFile;


   hFile = CreateFile(
      portName,
      GENERIC_READ | GENERIC_WRITE,
      0,
      NULL,
      OPEN_EXISTING,
      0,
      NULL);
      
   if (INVALID_HANDLE_VALUE != hFile)
   {
      if (ReadSerial(hFile, buffer, MAX_BUFFER))
      {
         printf("Received: '%s'\r\n", buffer);
      }
   }
}

BOOL ReadSerial(HANDLE hFile, char * buffer, DWORD bufferSize)
{
   BOOL    retval;
   DWORD   dw;

   buffer[0] = '\0';
   retval = FALSE;

   if (ReadFile(hFile, buffer, bufferSize - 1, &dw, NULL))
   {
      retval = TRUE;
      buffer[dw] = '\0';
   }

   return retval;
}


"After all it's just text at the end of the day. - Colin Davies

"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
GeneralMultiway Tree Pin
vikramlinux28-Oct-04 23:30
vikramlinux28-Oct-04 23:30 
GeneralRe: Multiway Tree Pin
Blake Miller29-Oct-04 4:46
Blake Miller29-Oct-04 4:46 
GeneralRe: Multiway Tree Pin
David Crow29-Oct-04 5:39
David Crow29-Oct-04 5:39 
GeneralRe: Multiway Tree Pin
vikramlinux1-Nov-04 17:22
vikramlinux1-Nov-04 17:22 
GeneralRe: Multiway Tree Pin
David Crow2-Nov-04 2:52
David Crow2-Nov-04 2:52 
Question@@GDI drawing speed question?? Pin
Anonymous28-Oct-04 23:26
Anonymous28-Oct-04 23:26 
GeneralTooltips for combo Pin
balajeedurai28-Oct-04 22:21
balajeedurai28-Oct-04 22:21 
GeneralRe: Tooltips for combo Pin
hou_12628-Oct-04 22:38
hou_12628-Oct-04 22:38 
Generalinstall Pin
hou_12628-Oct-04 22:03
hou_12628-Oct-04 22:03 
GeneralRe: install Pin
Arsalan Malik28-Oct-04 23:13
Arsalan Malik28-Oct-04 23:13 
GeneralRe: install Pin
ThatsAlok29-Oct-04 0:03
ThatsAlok29-Oct-04 0:03 
GeneralBrowser Control performance Issue Pin
nabil_shams28-Oct-04 21:47
nabil_shams28-Oct-04 21:47 
GeneralRe: Browser Control performance Issue Pin
Sujan Christo29-Oct-04 1:10
Sujan Christo29-Oct-04 1:10 
Generalaudio - waveInPrepareHeader() problem Pin
normanS28-Oct-04 21:46
normanS28-Oct-04 21:46 
GeneralRe: audio - waveInPrepareHeader() problem Pin
Blake Miller29-Oct-04 4:54
Blake Miller29-Oct-04 4:54 
GeneralRe: audio - waveInPrepareHeader() problem Pin
Anonymous29-Oct-04 19:06
Anonymous29-Oct-04 19:06 
GeneralRe: audio - waveInPrepareHeader() problem Pin
Blake Miller1-Nov-04 4:09
Blake Miller1-Nov-04 4:09 

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.