Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to delete char Array-Memory leak detection Pin
Stefan_Lang20-Jul-11 1:21
Stefan_Lang20-Jul-11 1:21 
AnswerRe: How to delete char Array-Memory leak detection Pin
Albert Holguin18-Jul-11 5:31
professionalAlbert Holguin18-Jul-11 5:31 
QuestionHow to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 20:42
Le@rner17-Jul-11 20:42 
AnswerRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 20:50
Code-o-mat17-Jul-11 20:50 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 20:56
Le@rner17-Jul-11 20:56 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 21:36
Code-o-mat17-Jul-11 21:36 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 21:38
Le@rner17-Jul-11 21:38 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 21:52
Code-o-mat17-Jul-11 21:52 
The code fragment you have shown opens and closes the ports one-by-one. You should rethink your strategy i guess. Without knowing more about what exactly you are trying to achieve it is hard to guess on anything, but you could for example try strating a new thread for each port if there aren't too many ports you want to use (of course you would need to implement proper synchronization as needed), or you could have an array for the port class instances, something like this:
CPort_Class *ports = new CPort_Class[portcount]
for (int port = 0; port < portcount; port++) ports[port].Open();
...
//now you have an array of ports that are opened simulteniously, do what you need with them
...
for (int port = 0; port < portcount; port++) ports[port].Close(); //you could put a call to Close() in
                                                                  //the destructor of this class possibly
delete []ports;
This is a simplified code fragment, you would of course need to do error checks too.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<

GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Le@rner17-Jul-11 22:05
Le@rner17-Jul-11 22:05 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat17-Jul-11 22:35
Code-o-mat17-Jul-11 22:35 
GeneralMessage Removed Pin
16-Dec-11 0:14
Le@rner16-Dec-11 0:14 
GeneralRe: How to open and read/write from multiple serial ports at the same time? Pin
Code-o-mat16-Dec-11 0:29
Code-o-mat16-Dec-11 0:29 
Questionarray declaration Pin
Danzy8317-Jul-11 10:17
Danzy8317-Jul-11 10:17 
AnswerRe: array declaration Pin
Richard Andrew x6417-Jul-11 10:47
professionalRichard Andrew x6417-Jul-11 10:47 
GeneralRe: array declaration [modified] Pin
Danzy8317-Jul-11 11:56
Danzy8317-Jul-11 11:56 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 13:45
professionalRichard Andrew x6417-Jul-11 13:45 
GeneralRe: array declaration Pin
Richard MacCutchan17-Jul-11 22:59
mveRichard MacCutchan17-Jul-11 22:59 
AnswerRe: array declaration Pin
«_Superman_»17-Jul-11 15:45
professional«_Superman_»17-Jul-11 15:45 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 16:14
professionalRichard Andrew x6417-Jul-11 16:14 
GeneralRe: array declaration Pin
«_Superman_»17-Jul-11 16:33
professional«_Superman_»17-Jul-11 16:33 
GeneralRe: array declaration Pin
Richard Andrew x6417-Jul-11 17:32
professionalRichard Andrew x6417-Jul-11 17:32 
GeneralRe: array declaration Pin
Richard MacCutchan17-Jul-11 23:08
mveRichard MacCutchan17-Jul-11 23:08 
GeneralRe: array declaration Pin
«_Superman_»18-Jul-11 9:10
professional«_Superman_»18-Jul-11 9:10 
GeneralRe: array declaration Pin
Richard MacCutchan18-Jul-11 9:19
mveRichard MacCutchan18-Jul-11 9:19 
QuestionControlling microphone gain using "mixer" API? Pin
Vaclav_17-Jul-11 7:40
Vaclav_17-Jul-11 7:40 

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.