Click here to Skip to main content
15,922,523 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to transfer wav file using parallel port in visual c++ Pin
sysrye31-Aug-04 15:51
sysrye31-Aug-04 15:51 
GeneralGenerate GUID from code Pin
AssemblySoft31-Aug-04 14:12
AssemblySoft31-Aug-04 14:12 
GeneralRe: Generate GUID from code Pin
Lim Bio Liong31-Aug-04 17:18
Lim Bio Liong31-Aug-04 17:18 
GeneralRe: Generate GUID from code Pin
AssemblySoft1-Sep-04 5:38
AssemblySoft1-Sep-04 5:38 
GeneralMessageBox Help Pin
Paul Belikian31-Aug-04 14:06
Paul Belikian31-Aug-04 14:06 
Generalhelp file Pin
Marcus Spitzmiller31-Aug-04 13:50
Marcus Spitzmiller31-Aug-04 13:50 
QuestionHow to Write an RS422 Interface in C++ Pin
Norman Hines31-Aug-04 12:17
Norman Hines31-Aug-04 12:17 
AnswerRe: How to Write an RS422 Interface in C++ Pin
Ryan Binns31-Aug-04 18:31
Ryan Binns31-Aug-04 18:31 
Norman Hines wrote:
I need a simple (perhaps over-simplified, or even simplistic) instruction on how to create/establish/connect to the communication resource, transmit messages at specific times, receive messages, and terminate everything before shut down.

Serial ports are opened using CreateFile(), specifying "COMx" as the filename, where x is the number of the COM port. Reading, writing is done using ReadFile(), WriteFile() and CloseHandle() as for normal files.

As for sending messages at specific times, I don't know what the best way would be, especially with sub-millisecond performance required. Windows is notorious for having dodgy, inaccurate timing at best. A sleep for a single millisecond can last upwards of 20ms depending on system load. If you need a round-trip response time of 36.1us, the only way forward using Windows (that I can see) would be to use a realtime enviroment such as VentureCom's RTX extensions that you mentioned.

However, you could have a look at the performance counters or the multimedia timers. They may be able to cope with the timing precision required under low system load, but if other applications preempt your application, there's really nothing you can do about it. Even increasing your process' scheduler priority may not be enough.

Hope this helps,

Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

GeneralRe: How to Write an RS422 Interface in C++ Pin
Norman Hines2-Sep-04 14:22
Norman Hines2-Sep-04 14:22 
GeneralRe: How to Write an RS422 Interface in C++ Pin
Ryan Binns2-Sep-04 15:16
Ryan Binns2-Sep-04 15:16 
GeneralRe: How to Write an RS422 Interface in C++ Pin
Norman Hines2-Sep-04 15:29
Norman Hines2-Sep-04 15:29 
GeneralRe: How to Write an RS422 Interface in C++ Pin
Ryan Binns2-Sep-04 16:46
Ryan Binns2-Sep-04 16:46 
QuestionHow to find Memory Over Flow ? Pin
Amarelia31-Aug-04 11:50
Amarelia31-Aug-04 11:50 
AnswerRe: How to find Memory Over Flow ? Pin
mahade131-Aug-04 18:36
mahade131-Aug-04 18:36 
Generalconst char * Pin
rtb33331-Aug-04 11:47
rtb33331-Aug-04 11:47 
GeneralRe: const char * Pin
Ryan Binns31-Aug-04 18:36
Ryan Binns31-Aug-04 18:36 
Generalopening a command prompt inside a cdialog Pin
mickelliot31-Aug-04 11:13
mickelliot31-Aug-04 11:13 
GeneralRe: opening a command prompt inside a cdialog Pin
vcplusplus31-Aug-04 11:38
vcplusplus31-Aug-04 11:38 
GeneralCFormView and ActiveX Controls... Pin
herbert_chow31-Aug-04 10:57
herbert_chow31-Aug-04 10:57 
GeneralRe: CFormView and ActiveX Controls... Pin
herbert_chow31-Aug-04 14:12
herbert_chow31-Aug-04 14:12 
QuestionOverlay mode? Pin
Vilo99931-Aug-04 9:18
Vilo99931-Aug-04 9:18 
AnswerRe: Folder path for any Win OS? Pin
vcplusplus31-Aug-04 7:52
vcplusplus31-Aug-04 7:52 
GeneralGDI+ VC++ Access Violation Pin
Nicholas Cardi31-Aug-04 7:22
Nicholas Cardi31-Aug-04 7:22 
GeneralRe: GDI+ VC++ Access Violation Pin
Anonymous31-Aug-04 7:29
Anonymous31-Aug-04 7:29 
GeneralRe: GDI+ VC++ Access Violation Pin
Nicholas Cardi31-Aug-04 7:33
Nicholas Cardi31-Aug-04 7:33 

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.