Click here to Skip to main content
15,888,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Edit control in VC++ Pin
toxcct14-Apr-06 4:29
toxcct14-Apr-06 4:29 
AnswerRe: Edit control in VC++ Pin
Chris Losinger14-Apr-06 4:38
professionalChris Losinger14-Apr-06 4:38 
AnswerRe: Edit control in VC++ Pin
David Crow14-Apr-06 4:47
David Crow14-Apr-06 4:47 
QuestionA question about CTreeCtrl Pin
onlysaint14-Apr-06 4:00
onlysaint14-Apr-06 4:00 
AnswerRe: A question about CTreeCtrl Pin
Michael Dunn14-Apr-06 7:37
sitebuilderMichael Dunn14-Apr-06 7:37 
Questionhlp on comboboxes Pin
swapna_signsin14-Apr-06 3:33
swapna_signsin14-Apr-06 3:33 
AnswerRe: hlp on comboboxes Pin
David Crow14-Apr-06 3:50
David Crow14-Apr-06 3:50 
QuestionHardware abstraction layer Pin
Cedric Moonen14-Apr-06 3:09
Cedric Moonen14-Apr-06 3:09 
Hi.

I need to develop code that will be ported to several platforms (windows, embedded, ...) and I need to work with the serial port (which is of course platform specific). So I need to design an hardware abstraction layer. I was wondering what is the best way to go for that.

For now, what I have in mind is declare my class in a header file. The handle of the port and things that are related to the target platform are enclosed into preprocessor tags (#ifdef) so that they are not 'viewed' by the compiler if not required.
Then for the implementation of the class, I will have a cpp file for each platform. Each cpp file will be enabled (or disabled) by the preprocessor tags.

Like that, I don't have to bother of my target platform, I have a generic class that can be created without checking for the target platform.

Is this a good way to achieve that ? Or is there other methods ?
Thanks for your advices.
AnswerRe: Hardware abstraction layer Pin
Prakash Nadar14-Apr-06 3:20
Prakash Nadar14-Apr-06 3:20 
Questionworking with threads Pin
keerthikaaa14-Apr-06 2:28
keerthikaaa14-Apr-06 2:28 
AnswerRe: working with threads Pin
Cedric Moonen14-Apr-06 2:33
Cedric Moonen14-Apr-06 2:33 
AnswerRe: working with threads Pin
Aqueel14-Apr-06 2:43
Aqueel14-Apr-06 2:43 
AnswerRe: working with threads Pin
Russell'14-Apr-06 2:53
Russell'14-Apr-06 2:53 
AnswerRe: working with threads Pin
Hamid_RT14-Apr-06 5:00
Hamid_RT14-Apr-06 5:00 
AnswerRe: working with threads Pin
Le Thanh Cong16-Apr-06 22:02
Le Thanh Cong16-Apr-06 22:02 
Questiondispinterface keyword Pin
Identity Undisclosed14-Apr-06 2:23
Identity Undisclosed14-Apr-06 2:23 
QuestionCOMMAND LINE ARGUMENT Pin
jai_sendme14-Apr-06 2:09
jai_sendme14-Apr-06 2:09 
AnswerRe: COMMAND LINE ARGUMENT Pin
parichaybp14-Apr-06 2:15
parichaybp14-Apr-06 2:15 
GeneralRe: COMMAND LINE ARGUMENT Pin
Cedric Moonen14-Apr-06 2:20
Cedric Moonen14-Apr-06 2:20 
JokeRe: COMMAND LINE ARGUMENT Pin
toxcct14-Apr-06 2:21
toxcct14-Apr-06 2:21 
GeneralRe: COMMAND LINE ARGUMENT Pin
jai_sendme14-Apr-06 4:51
jai_sendme14-Apr-06 4:51 
QuestionRe: COMMAND LINE ARGUMENT Pin
David Crow14-Apr-06 2:18
David Crow14-Apr-06 2:18 
AnswerRe: COMMAND LINE ARGUMENT Pin
Cedric Moonen14-Apr-06 2:19
Cedric Moonen14-Apr-06 2:19 
JokeRe: COMMAND LINE ARGUMENT Pin
toxcct14-Apr-06 2:21
toxcct14-Apr-06 2:21 
GeneralRe: COMMAND LINE ARGUMENT Pin
Cedric Moonen14-Apr-06 3:55
Cedric Moonen14-Apr-06 3:55 

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.