Click here to Skip to main content
15,902,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert CImageList image to transparent GIF Pin
Neville Franks9-Nov-08 12:49
Neville Franks9-Nov-08 12:49 
GeneralRe: Convert CImageList image to transparent GIF Pin
Mark Salsbery10-Nov-08 4:56
Mark Salsbery10-Nov-08 4:56 
QuestionStruct memory allocation question Pin
thespiff30-Oct-07 10:34
thespiff30-Oct-07 10:34 
AnswerRe: Struct memory allocation question Pin
Mark Salsbery30-Oct-07 10:45
Mark Salsbery30-Oct-07 10:45 
GeneralRe: Struct memory allocation question Pin
led mike30-Oct-07 11:10
led mike30-Oct-07 11:10 
GeneralRe: Struct memory allocation question Pin
Mark Salsbery30-Oct-07 11:32
Mark Salsbery30-Oct-07 11:32 
AnswerRe: Struct memory allocation question Pin
John R. Shaw30-Oct-07 15:09
John R. Shaw30-Oct-07 15:09 
AnswerRe: Struct memory allocation question Pin
Neo Andreson30-Oct-07 20:16
Neo Andreson30-Oct-07 20:16 
search for structure packing, pack your structure for 1 byte.
then
any way you have all the data in an char array,

so try this,

struct MyStruct
{
char a;//1 byte
int b;//4 byte
int c;//4 byte
};


int main()
{
MyStruct MyObj;
MyStruct* l_Stemp = &MyObj;

//You have an array of 9 bytes
//let's say as l_Carr[9];

char* l_cPtr = reinterprete_cast<char*>(l_Stemp);

//Here address of l_Stemp and l_cPtr is same so u can write values to l_cPtr using and read it from l_Stemp

for(int i=0;i<9;i++)
{
*l_cPtr++=l_Carr[i];
}
//Here u'd get ur struct back in the form of l_Stemp pointer, While using this u have to be very careful because,
// pointer is poweful but power comes with responsibility

return 0;
}
}
// I did not compile this program if any compilation error is thr pls let me know
GeneralRe: Struct memory allocation question Pin
Mark Salsbery31-Oct-07 6:02
Mark Salsbery31-Oct-07 6:02 
Questioncctype and If ( ) Pin
pourang30-Oct-07 9:30
pourang30-Oct-07 9:30 
AnswerRe: cctype and If ( ) Pin
Mark Salsbery30-Oct-07 10:11
Mark Salsbery30-Oct-07 10:11 
GeneralRe: cctype and If ( ) Pin
pourang30-Oct-07 10:16
pourang30-Oct-07 10:16 
GeneralRe: cctype and If ( ) Pin
John R. Shaw30-Oct-07 16:19
John R. Shaw30-Oct-07 16:19 
Questionunexpected error [please help] Pin
sarojsigdel30-Oct-07 8:48
sarojsigdel30-Oct-07 8:48 
AnswerRe: unexpected error Pin
Mark Salsbery30-Oct-07 10:15
Mark Salsbery30-Oct-07 10:15 
GeneralRe: unexpected error Pin
sarojsigdel30-Oct-07 10:28
sarojsigdel30-Oct-07 10:28 
GeneralRe: unexpected error Pin
Mark Salsbery30-Oct-07 10:35
Mark Salsbery30-Oct-07 10:35 
GeneralRe: unexpected error Pin
sarojsigdel30-Oct-07 10:52
sarojsigdel30-Oct-07 10:52 
GeneralRe: unexpected error Pin
Mark Salsbery30-Oct-07 11:00
Mark Salsbery30-Oct-07 11:00 
QuestionMinimizing a Dialog Pin
69 Bay30-Oct-07 8:03
69 Bay30-Oct-07 8:03 
AnswerRe: Minimizing a Dialog Pin
Llasus30-Oct-07 14:07
Llasus30-Oct-07 14:07 
AnswerRe: Minimizing a Dialog Pin
Nishad S30-Oct-07 18:05
Nishad S30-Oct-07 18:05 
AnswerRe: Minimizing a Dialog Pin
Hamid_RT31-Oct-07 4:20
Hamid_RT31-Oct-07 4:20 
QuestionComments in Visual Studio 2005 Pro Pin
Like2Byte30-Oct-07 8:01
Like2Byte30-Oct-07 8:01 
QuestionHow to prevent direct execution of .msi? Pin
popopo30-Oct-07 7:47
popopo30-Oct-07 7:47 

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.