Click here to Skip to main content
15,921,643 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange Debugging results Pin
Richard MacCutchan25-Feb-18 6:20
mveRichard MacCutchan25-Feb-18 6:20 
GeneralRe: Strange Debugging results Pin
ForNow25-Feb-18 6:56
ForNow25-Feb-18 6:56 
GeneralRe: Strange Debugging results Pin
ForNow25-Feb-18 8:28
ForNow25-Feb-18 8:28 
GeneralRe: Strange Debugging results Pin
Richard MacCutchan25-Feb-18 21:36
mveRichard MacCutchan25-Feb-18 21:36 
GeneralRe: Strange Debugging results Pin
ForNow26-Feb-18 1:53
ForNow26-Feb-18 1:53 
QuestionWhen an process is loaded Pin
_Flaviu22-Feb-18 23:15
_Flaviu22-Feb-18 23:15 
QuestionRe: When an process is loaded Pin
Richard MacCutchan22-Feb-18 23:18
mveRichard MacCutchan22-Feb-18 23:18 
AnswerRe: When an process is loaded Pin
_Flaviu22-Feb-18 23:35
_Flaviu22-Feb-18 23:35 
GeneralRe: When an process is loaded Pin
Richard MacCutchan22-Feb-18 23:48
mveRichard MacCutchan22-Feb-18 23:48 
QuestionCdialog CWnd* pParent null after passing this pointer to Cdialog constructer Pin
ForNow22-Feb-18 16:46
ForNow22-Feb-18 16:46 
AnswerRe: Cdialog CWnd* pParent null after passing this pointer to Cdialog constructer Pin
leon de boer22-Feb-18 20:25
leon de boer22-Feb-18 20:25 
GeneralRe: Cdialog CWnd* pParent null after passing this pointer to Cdialog constructer Pin
ForNow22-Feb-18 21:13
ForNow22-Feb-18 21:13 
GeneralRe: Cdialog CWnd* pParent null after passing this pointer to Cdialog constructer Pin
leon de boer22-Feb-18 21:26
leon de boer22-Feb-18 21:26 
QuestionCOM usage issue Pin
Fedrer21-Feb-18 21:23
Fedrer21-Feb-18 21:23 
AnswerRe: COM usage issue Pin
Richard MacCutchan21-Feb-18 21:28
mveRichard MacCutchan21-Feb-18 21:28 
GeneralRe: COM usage issue Pin
Fedrer21-Feb-18 21:35
Fedrer21-Feb-18 21:35 
GeneralRe: COM usage issue Pin
Richard MacCutchan21-Feb-18 21:56
mveRichard MacCutchan21-Feb-18 21:56 
GeneralRe: COM usage issue Pin
Fedrer21-Feb-18 23:51
Fedrer21-Feb-18 23:51 
GeneralRe: COM usage issue Pin
CPallini22-Feb-18 0:30
mveCPallini22-Feb-18 0:30 
QuestionCleaver macro (string concatenation?) or function to optimize size of array by turning it into a struct/linked list? Pin
arnold_w19-Feb-18 22:16
arnold_w19-Feb-18 22:16 
AnswerRe: Cleaver macro (string concatenation?) or function to optimize size of array by turning it into a struct/linked list? Pin
leon de boer20-Feb-18 7:53
leon de boer20-Feb-18 7:53 
You are making hard work of it, you have a C11 compiler Smile | :)

Unionize the struct pointers .. they are all pointers to different types

typedef union {
	void* void_ptr;
	struct mySmallStruct1_s* SmallStruct1_ptr;
	struct mySmallStruct2_s* SmallStruct2_ptr;
	struct mySmallStruct3_s* SmallStruct3_ptr;
} smallstruct_ptr;

struct mySmallStruct1_s {
	smallstruct_ptr ptrToNextElement;
	int myArray[1];
};

struct mySmallStruct2_s {
	smallstruct_ptr ptrToNextElement;
	int myArray[2];
};

struct mySmallStruct3_s {
	smallstruct_ptr ptrToNextElement;
	int myArray[3];
};

struct myBigStruct_s {
	struct mySmallStruct1_s mySmallStruct1;
	struct mySmallStruct2_s mySmallStruct2;
	struct mySmallStruct3_s mySmallStruct3;
};


struct myBigStruct_s myBigStruct = {
	{ .ptrToNextElement.SmallStruct2_ptr = &myBigStruct.mySmallStruct2, .myArray[0] = 0 },
	{ .ptrToNextElement.SmallStruct3_ptr = &myBigStruct.mySmallStruct3,  .myArray[0] = 0, .myArray[1] = 0 },
	{ .ptrToNextElement.void_ptr = 0,.myArray[0] = 0,.myArray[1] = 0, .myArray[2] = 0 }
};


struct myBigStruct_s myBigStruct1 = {
	{ .ptrToNextElement.SmallStruct2_ptr = &myBigStruct1.mySmallStruct2,.myArray[0] = 1 },
	{ .ptrToNextElement.SmallStruct3_ptr = &myBigStruct1.mySmallStruct3,.myArray[0] = 1,.myArray[1] = 2 },
	{ .ptrToNextElement.void_ptr = 0, .myArray[0] = 1,.myArray[1] = 2,.myArray[2] = 3 }
};

In vino veritas

QuestionHow to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec18-Feb-18 19:13
Łukasz Gęsieniec18-Feb-18 19:13 
AnswerRe: How to redirect WriteFile func writes to console Pin
leon de boer18-Feb-18 19:59
leon de boer18-Feb-18 19:59 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec18-Feb-18 20:10
Łukasz Gęsieniec18-Feb-18 20:10 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer18-Feb-18 21:06
leon de boer18-Feb-18 21:06 

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.