Click here to Skip to main content
14,669,072 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Know when a files has been copied Pin
Richard MacCutchan28-May-19 5:50
mveRichard MacCutchan28-May-19 5:50 
AnswerRe: Know when a files has been copied Pin
Victor Nijegorodov28-May-19 20:37
MemberVictor Nijegorodov28-May-19 20:37 
AnswerRe: Know when a files has been copied Pin
Dave Kreskowiak31-May-19 2:49
mveDave Kreskowiak31-May-19 2:49 
QuestionI have 3rd party . OCX file. which loads in HTML scripts and do desired work Pin
Gaurav__Kapoor26-May-19 22:12
MemberGaurav__Kapoor26-May-19 22:12 
AnswerRe: I have 3rd party . OCX file. which loads in HTML scripts and do desired work Pin
Richard MacCutchan26-May-19 22:35
mveRichard MacCutchan26-May-19 22:35 
GeneralRe: I have 3rd party . OCX file. which loads in HTML scripts and do desired work Pin
Gaurav__Kapoor27-May-19 2:17
MemberGaurav__Kapoor27-May-19 2:17 
GeneralRe: I have 3rd party . OCX file. which loads in HTML scripts and do desired work Pin
Richard MacCutchan27-May-19 3:40
mveRichard MacCutchan27-May-19 3:40 
QuestionClever macro to handle consecutive addresses with built-in static_assert Pin
arnold_w24-May-19 22:54
Memberarnold_w24-May-19 22:54 
I'm writing code for a microcontroller in standard C and I'm compiling with GCC. My product has registers with addresses:
enum regAddr_e {
   REG_A = 0,
   REG_B = 2,
   REG_C = 4
};

typedef struct {
    regAddr_e regAddr;
    uint16_t regValue;
} regAddrAndValue_s;
When I want to write to registers, I create an array of regAddrAndValue_s and pass it to my write function. However, I have found that I quite often write to consecutive addresses so a lot of times only the start address would be needed:
typedef struct {
    regAddr_e startRegAddr;
    uint16_t regValues[];
} consecutiveRegAddrAndValues_s;
However, as a documentation I would like to keep all registers visible in the code. So, I would like have a macro that does something like this:
#define MY_CLEVER_MACRO(__NAME_OF_STRUCT_VARIABLE__)   \
   REG_A, 0x0123,                                      \
   REG_B, 0x04567,                                     \
   REG_C, 0x89AB                                        
The macro should produce:
consecutiveRegAddrAndValues_s __NAME_OF_STRUCT_VARIABLE__ = {REG_A, {0x0123, 0x4567, 0x89AB}};
Also, if someone changes the register addresses so that a range is no longer consecutive, then I would like to throw a compile-time static_assert. Can someone please help me what MY_CLEVER_MACRO should look like?
AnswerRe: Clever macro to handle consecutive addresses with built-in static_assert Pin
Stefan_Lang26-May-19 22:15
mveStefan_Lang26-May-19 22:15 
Question"A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
Vaclav_19-May-19 16:54
MemberVaclav_19-May-19 16:54 
AnswerRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
Richard MacCutchan19-May-19 21:28
mveRichard MacCutchan19-May-19 21:28 
AnswerRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
leon de boer20-May-19 3:01
Memberleon de boer20-May-19 3:01 
AnswerRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
jschell23-May-19 5:50
Memberjschell23-May-19 5:50 
GeneralRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
Daniel Pfeffer23-May-19 23:34
professionalDaniel Pfeffer23-May-19 23:34 
GeneralRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
Peter_in_278024-May-19 0:17
professionalPeter_in_278024-May-19 0:17 
GeneralRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
Daniel Pfeffer24-May-19 4:39
professionalDaniel Pfeffer24-May-19 4:39 
GeneralRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
jschell2-Jun-19 8:26
Memberjschell2-Jun-19 8:26 
GeneralRe: "A rose by any other name would smell as sweet" - so what is the BEST name for "open_dev" function return? Pin
Peter_in_278024-May-19 0:19
professionalPeter_in_278024-May-19 0:19 
QuestionVisual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton19-May-19 2:19
MemberMichael Hinton19-May-19 2:19 
AnswerRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
phil.o19-May-19 2:28
mvephil.o19-May-19 2:28 
GeneralRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton21-May-19 19:46
MemberMichael Hinton21-May-19 19:46 
GeneralRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
phil.o21-May-19 20:42
mvephil.o21-May-19 20:42 
AnswerRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Richard MacCutchan19-May-19 5:19
mveRichard MacCutchan19-May-19 5:19 
GeneralRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Michael Hinton21-May-19 19:46
MemberMichael Hinton21-May-19 19:46 
GeneralRe: Visual C++ 6.0 Release, but cannot get original Source Code Pin
Richard MacCutchan21-May-19 21:27
mveRichard MacCutchan21-May-19 21:27 

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.