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

C / C++ / MFC

 
GeneralRe: Convert CImageList image to transparent GIF Pin
Neville Franks31-Oct-07 11:07
Neville Franks31-Oct-07 11:07 
GeneralRe: Convert CImageList image to transparent GIF Pin
Mark Salsbery31-Oct-07 12:05
Mark Salsbery31-Oct-07 12:05 
GeneralRe: Convert CImageList image to transparent GIF Pin
Neville Franks31-Oct-07 21:32
Neville Franks31-Oct-07 21:32 
GeneralRe: Convert CImageList image to transparent GIF Pin
Mark Salsbery1-Nov-07 5:37
Mark Salsbery1-Nov-07 5:37 
GeneralRe: Convert CImageList image to transparent GIF Pin
Neville Franks1-Nov-07 23:13
Neville Franks1-Nov-07 23:13 
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 
I'm doing binary file input and I want to read 4 32-bit values in binary from a file with the read() command as elegantly as possible. Read gives me back a pointer to a char array of 16 chars (16 bytes of binary data representing the 4 32-bit values, called headerValPtr)

So I have a simple struct:
myStruct
{
int
int
float
float
}

My data types in the struct are 32-bit unsigned integers and floating point vals. So I create a pointer to myStruct and allocate memory for it, call it sillyStruct. Will it work to then say sillyStruct = (myStruct*)headerValPtr? I just want to typecast the binary data into the 4 values in the struct.

I don't have a good textbook handy to see how struct allocates memory. If the struct pointer simply points to a set of consecutive memory locations that hold all of the data, then I'm good. But I'm not 100% sure that is the case.

If you want real code snippets I can throw something together, but this is more of a theoretical question so maybe you can live without?

Thanks,
--Seth
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 
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 

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.