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

C / C++ / MFC

 
AnswerRe: unary minus operator applied to unsigned type, result still unsigned Pin
phil.o3-Oct-19 23:50
professionalphil.o3-Oct-19 23:50 
PraiseRe: unary minus operator applied to unsigned type, result still unsigned Pin
_Flaviu4-Oct-19 0:57
_Flaviu4-Oct-19 0:57 
QuestionOnInitDialog() MFC vc++ Pin
Member 145755563-Oct-19 19:32
Member 145755563-Oct-19 19:32 
AnswerRe: OnInitDialog() MFC vc++ Pin
Richard MacCutchan3-Oct-19 20:58
mveRichard MacCutchan3-Oct-19 20:58 
QuestionHow should I manage my register addresses and expose some of them properly and ensure consistency? Pin
arnold_w3-Oct-19 8:00
arnold_w3-Oct-19 8:00 
AnswerRe: How should I manage my register addresses and expose some of them properly and ensure consistency? Pin
Daniel Pfeffer3-Oct-19 20:27
professionalDaniel Pfeffer3-Oct-19 20:27 
GeneralRe: How should I manage my register addresses and expose some of them properly and ensure consistency? Pin
arnold_w3-Oct-19 20:58
arnold_w3-Oct-19 20:58 
GeneralRe: How should I manage my register addresses and expose some of them properly and ensure consistency? Pin
leon de boer4-Oct-19 4:23
leon de boer4-Oct-19 4:23 
It doesn't change what he said generally you want to abstract the interface to functionality not physicality ... you are connecting things.

You are doing "things" when you have to access the registers, you don't just randomly decide to access the registers.
At the moment you are worrying so much about the physical you aren't even thinking about the functionality.

If you consider something like ReadFile or WriteFile they are functions, yet they can whack all sorts of registers from COM port, USB drives, SATA drives. You don't have to provide registers to those functions it works it out from the name and it is all nicely hidden behind the interface. Even consider ethernet socket programming, lots of registers getting used but not once do you ever deal with them. You deal with functionality connect, listen, send, poll etc.

If you consider Linux and Windows and how complex they are they never expose registers outside the driver and the driver interface is purely a functional api. Granted they have the added problem they may need to share registers between threads/tasks etc but that is just another reason to hide register access below a functional abstraction.

So stop and think what functionality are you doing when you need to whack the registers and can you make a nice functional interface that hides the registers into a common block so they don't ever have to be exposed.
In vino veritas


modified 4-Oct-19 10:46am.

GeneralRe: How should I manage my register addresses and expose some of them properly and ensure consistency? Pin
arnold_w9-Oct-19 22:46
arnold_w9-Oct-19 22:46 
QuestionS_IRUSR S_IWUSR Pin
_Flaviu3-Oct-19 7:12
_Flaviu3-Oct-19 7:12 
AnswerRe: S_IRUSR S_IWUSR Pin
Richard MacCutchan3-Oct-19 7:32
mveRichard MacCutchan3-Oct-19 7:32 
AnswerRe: S_IRUSR S_IWUSR Pin
David Crow3-Oct-19 7:33
David Crow3-Oct-19 7:33 
AnswerRe: S_IRUSR S_IWUSR Pin
CPallini3-Oct-19 7:46
mveCPallini3-Oct-19 7:46 
QuestionTool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w3-Oct-19 1:27
arnold_w3-Oct-19 1:27 
AnswerRe: Tool to replace tabs with --- variable number of spaces --- and preserving width? Pin
_Flaviu3-Oct-19 1:32
_Flaviu3-Oct-19 1:32 
GeneralRe: Tool to replace tabs with --- variable number of spaces --- and preserving width? Pin
arnold_w3-Oct-19 1:52
arnold_w3-Oct-19 1:52 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
Richard MacCutchan3-Oct-19 2:16
mveRichard MacCutchan3-Oct-19 2:16 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
phil.o3-Oct-19 2:29
professionalphil.o3-Oct-19 2:29 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
Richard MacCutchan3-Oct-19 2:37
mveRichard MacCutchan3-Oct-19 2:37 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
phil.o3-Oct-19 2:46
professionalphil.o3-Oct-19 2:46 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
Richard MacCutchan3-Oct-19 2:53
mveRichard MacCutchan3-Oct-19 2:53 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
phil.o3-Oct-19 2:27
professionalphil.o3-Oct-19 2:27 
AnswerRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
leon de boer3-Oct-19 6:38
leon de boer3-Oct-19 6:38 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
arnold_w3-Oct-19 6:41
arnold_w3-Oct-19 6:41 
GeneralRe: Tool to replace tabs with VARIABLE NUMBER OF SPACES and preserve column alignment? Pin
leon de boer4-Oct-19 3:52
leon de boer4-Oct-19 3:52 

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.