Click here to Skip to main content
15,886,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: .bmp and .ico MFC vc++ Pin
Member 1457555625-Oct-19 3:23
Member 1457555625-Oct-19 3:23 
GeneralRe: .bmp and .ico MFC vc++ Pin
leon de boer24-Oct-19 15:10
leon de boer24-Oct-19 15:10 
GeneralRe: .bmp and .ico MFC vc++ Pin
Richard MacCutchan24-Oct-19 21:42
mveRichard MacCutchan24-Oct-19 21:42 
GeneralRe: .bmp and .ico MFC vc++ Pin
Victor Nijegorodov24-Oct-19 23:19
Victor Nijegorodov24-Oct-19 23:19 
GeneralRe: .bmp and .ico MFC vc++ Pin
leon de boer25-Oct-19 5:07
leon de boer25-Oct-19 5:07 
AnswerRe: .bmp and .ico MFC vc++ Pin
Richard MacCutchan24-Oct-19 4:05
mveRichard MacCutchan24-Oct-19 4:05 
GeneralRe: .bmp and .ico MFC vc++ Pin
Member 1457555625-Oct-19 3:26
Member 1457555625-Oct-19 3:26 
QuestionWhy can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
arnold_w22-Oct-19 22:33
arnold_w22-Oct-19 22:33 
I need to save space and reduce some of my function pointers from 32-bit to 16-bit and this is ok since the flash region I've specified in the linker script is only 32 kBytes. Does anybody know how I can make my 3rd example below compile properly?
C++
typedef struct {
    uint16_t myFunctPtrTruncated;
} myUint16struct_s;

typedef struct {
    void* myFunctPtr;
} myVoidstruct_s;

static void myDummyFunc()  {}

myVoidstruct_s   myStruct1 = { myDummyFunc  };                    // Ok
myUint16struct_s myStruct2 = { 0  };                              // Ok
myUint16struct_s myStruct3 = { (uint16_t)(uint32_t)myDummyFunc }; // Error: "initializer element is not constant"

GeneralRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
Richard MacCutchan22-Oct-19 23:35
mveRichard MacCutchan22-Oct-19 23:35 
GeneralRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
arnold_w23-Oct-19 0:49
arnold_w23-Oct-19 0:49 
GeneralRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
Richard MacCutchan23-Oct-19 1:29
mveRichard MacCutchan23-Oct-19 1:29 
QuestionRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
CPallini23-Oct-19 1:25
mveCPallini23-Oct-19 1:25 
AnswerRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
leon de boer23-Oct-19 2:21
leon de boer23-Oct-19 2:21 
GeneralRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
arnold_w23-Oct-19 2:26
arnold_w23-Oct-19 2:26 
GeneralRe: Why can't I initialize ("initializer element is not constant") a struct with a truncated function pointer? Pin
leon de boer23-Oct-19 2:30
leon de boer23-Oct-19 2:30 
QuestionAMD or Intel Pin
_Flaviu22-Oct-19 9:00
_Flaviu22-Oct-19 9:00 
QuestionRe: AMD or Intel Pin
David Crow22-Oct-19 10:00
David Crow22-Oct-19 10:00 
AnswerRe: AMD or Intel Pin
_Flaviu22-Oct-19 19:35
_Flaviu22-Oct-19 19:35 
GeneralRe: AMD or Intel Pin
Richard MacCutchan22-Oct-19 21:42
mveRichard MacCutchan22-Oct-19 21:42 
GeneralRe: AMD or Intel Pin
_Flaviu22-Oct-19 22:53
_Flaviu22-Oct-19 22:53 
GeneralRe: AMD or Intel Pin
Richard MacCutchan22-Oct-19 23:12
mveRichard MacCutchan22-Oct-19 23:12 
GeneralRe: AMD or Intel Pin
_Flaviu23-Oct-19 0:39
_Flaviu23-Oct-19 0:39 
GeneralRe: AMD or Intel Pin
Richard MacCutchan23-Oct-19 0:52
mveRichard MacCutchan23-Oct-19 0:52 
GeneralRe: AMD or Intel Pin
_Flaviu23-Oct-19 1:28
_Flaviu23-Oct-19 1:28 
GeneralRe: AMD or Intel Pin
Richard MacCutchan23-Oct-19 1:31
mveRichard MacCutchan23-Oct-19 1:31 

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.