Click here to Skip to main content
16,004,806 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: use of extern Pin
_AnsHUMAN_ 12-May-06 1:06
_AnsHUMAN_ 12-May-06 1:06 
GeneralRe: use of extern Pin
Shamnar15-May-06 0:34
Shamnar15-May-06 0:34 
GeneralRe: use of extern Pin
S. Senthil Kumar15-May-06 1:59
S. Senthil Kumar15-May-06 1:59 
GeneralRe: use of extern Pin
Shamnar16-May-06 1:24
Shamnar16-May-06 1:24 
QuestionProblems in Cross Platform Enryption? Pin
He is Cool11-May-06 18:35
He is Cool11-May-06 18:35 
AnswerRe: Problems in Cross Platform Enryption? Pin
Milton Karimbekallil13-May-06 0:40
Milton Karimbekallil13-May-06 0:40 
QuestionHow to use the SerialPort->Write function Pin
ShayD110-May-06 20:24
ShayD110-May-06 20:24 
AnswerRe: How to use the SerialPort->Write function Pin
Milton Karimbekallil11-May-06 1:56
Milton Karimbekallil11-May-06 1:56 
Call createfile to get a valid handle to the port:

hPort = CreateFile(lpszPortName, GENERIC_READ | GENERIC_WRITE, 0, NULL,<br />
                       OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL |<br />
                       FILE_FLAG_OVERLAPPED, NULL); // NT wants overlapped


Then set the device control block with appropriate baude rate and parity bit settings and other settings.
<br />
DCB dcb; <br />
dcb.DCBlength = sizeof( DCB ) ;<br />
GetCommState( ufp, &dcb ) ;<br />
//change settings as required by the device connected the serial port.    <br />
dcb.BaudRate = baud;<br />
//set the new value back<br />
SetCommState(ufp, &dcb);


Now you can start writing to the device.

WriteFile(hPort, bfr2write, dwBytestoWrite, &dwBytesWritten, &OVERLAPPEDWrite);

To Readfrom the file:

ClearCommError( hPort, &dwErrorFlags, &ComStat ) ;      // Clear error flag<br />
 dwLength = min( (DWORD) MaxLength, ComStat.cbInQue ); // # of bytes to get <br />
 if (dwLength > 0) {<br />
   fReadStat = ReadFile( hPort, lpzBlock,                  // Do the READ<br />
                         dwLength, &dwLength, &osRead ) ;<br />
   if (!fReadStat) {<br />
      Err("ReadSPort");<br />
      dwLength = 0 ;<br />
      ClearCommError( hPort, &dwErrorFlags, &ComStat ) ;<br />
   }<br />
 }


cheers...milton.
GeneralRe: How to use the SerialPort->Write function Pin
ShayD111-May-06 2:33
ShayD111-May-06 2:33 
GeneralRe: How to use the SerialPort->Write function Pin
Milton Karimbekallil11-May-06 3:19
Milton Karimbekallil11-May-06 3:19 
QuestionMarshalling a pointer Pin
Ilkka Pitkänen10-May-06 1:04
Ilkka Pitkänen10-May-06 1:04 
AnswerRe: Marshalling a pointer Pin
Milton Karimbekallil10-May-06 5:41
Milton Karimbekallil10-May-06 5:41 
QuestionClass Library Wraps Native dll Pin
rottencheese9-May-06 4:10
rottencheese9-May-06 4:10 
AnswerRe: Class Library Wraps Native dll Pin
Milton Karimbekallil10-May-06 2:30
Milton Karimbekallil10-May-06 2:30 
AnswerRe: Class Library Wraps Native dll Pin
mjmim11-May-06 11:01
mjmim11-May-06 11:01 
QuestionIntegrating vc++ code with c# Pin
Ashraj19828-May-06 20:30
Ashraj19828-May-06 20:30 
AnswerRe: Integrating vc++ code with c# Pin
led mike9-May-06 17:52
led mike9-May-06 17:52 
AnswerRe: Integrating vc++ code with c# Pin
Nish Nishant11-May-06 6:43
sitebuilderNish Nishant11-May-06 6:43 
QuestionHi, I want graphic base code! Pin
duyviet24128-May-06 16:59
duyviet24128-May-06 16:59 
AnswerRe: Hi, I want graphic base code! Pin
led mike8-May-06 17:18
led mike8-May-06 17:18 
QuestionCan anyone explain what this things do? Pin
Junon8-May-06 3:09
Junon8-May-06 3:09 
AnswerRe: Can anyone explain what this things do? Pin
led mike8-May-06 6:13
led mike8-May-06 6:13 
GeneralRe: Can anyone explain what this things do? Pin
Junon8-May-06 6:23
Junon8-May-06 6:23 
AnswerRe: Can anyone explain what this things do? Pin
led mike8-May-06 17:54
led mike8-May-06 17:54 
QuestionHow can I Export DllUnregisterServer in VC++? Pin
Orchid858-May-06 1:23
Orchid858-May-06 1:23 

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.