Click here to Skip to main content
16,015,097 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to create an icon for dll file? Pin
includeh1021-Feb-05 17:46
includeh1021-Feb-05 17:46 
AnswerRe: how to create an icon for dll file? Pin
Blake Miller22-Feb-05 4:56
Blake Miller22-Feb-05 4:56 
GeneralInkvoke web service from C++ through SoapClient Pin
Member 80845921-Feb-05 15:23
Member 80845921-Feb-05 15:23 
Generalreading and outputting data from a binary file... Pin
Moochie521-Feb-05 14:36
Moochie521-Feb-05 14:36 
GeneralRe: reading and outputting data from a binary file... Pin
S. Senthil Kumar21-Feb-05 15:25
S. Senthil Kumar21-Feb-05 15:25 
GeneralRe: reading and outputting data from a binary file... Pin
Moochie521-Feb-05 17:47
Moochie521-Feb-05 17:47 
GeneralRe: reading and outputting data from a binary file... Pin
S. Senthil Kumar21-Feb-05 17:58
S. Senthil Kumar21-Feb-05 17:58 
GeneralRe: reading and outputting data from a binary file... Pin
Cedric Moonen21-Feb-05 20:13
Cedric Moonen21-Feb-05 20:13 
The problem is probably due to the member structure alignement: the data in the file have probably been saved with another program which specified a member struct alignement of 1.

Member struct alignement means on which byte boundaries are stored all the fields of your structure in memory. Thus, specifying a member struct of 8 (the default), every fields of the structure start on a 8 byte boundary. When you try to read directly data from a file and 'copy' it in memory, if the structure was not saved with the same member struct alignement, this will results in misalignement of your fields (and so, you won't be able to read anything).

To avoid the problem, try to set the alignement of your structure to 1:
<br />
#pragma pack(1)<br />
<br />
struct Info<br />
{<br />
//unsigned short ID;<br />
int ID;<br />
float GPA, FinAid;<br />
<br />
char state[3];<br />
char gender[2];<br />
char Fname[15];<br />
char Lname[15];<br />
char status[15];<br />
};<br />
<br />
#pragma pack    // reset to default

Generalprocesses Pin
mpapeo21-Feb-05 14:06
mpapeo21-Feb-05 14:06 
GeneralRe: processes Pin
Aamir Butt22-Feb-05 0:17
Aamir Butt22-Feb-05 0:17 
GeneralRe: processes Pin
mpapeo28-Feb-05 16:31
mpapeo28-Feb-05 16:31 
GeneralDialog Bars in Dialog Based applications Pin
Will115721-Feb-05 12:49
sussWill115721-Feb-05 12:49 
GeneralRe: Dialog Bars in Dialog Based applications Pin
Will115721-Feb-05 13:13
sussWill115721-Feb-05 13:13 
GeneralRe: Dialog Bars in Dialog Based applications Pin
JohnCz21-Feb-05 13:50
JohnCz21-Feb-05 13:50 
GeneralRe: Dialog Bars in Dialog Based applications Pin
Mohammad Tarik22-Feb-05 1:23
Mohammad Tarik22-Feb-05 1:23 
GeneralProblem With Dll Injection Pin
gamitech21-Feb-05 10:37
gamitech21-Feb-05 10:37 
Generalstart when cd is in Pin
jonavon blakly21-Feb-05 7:40
jonavon blakly21-Feb-05 7:40 
GeneralRe: start when cd is in Pin
Ravi Bhavnani21-Feb-05 7:44
professionalRavi Bhavnani21-Feb-05 7:44 
GeneralSafe Exit Pin
DanYELL21-Feb-05 6:36
DanYELL21-Feb-05 6:36 
GeneralRe: Safe Exit Pin
Michael Dunn21-Feb-05 6:53
sitebuilderMichael Dunn21-Feb-05 6:53 
GeneralStatic map Pin
ralfeus21-Feb-05 4:57
ralfeus21-Feb-05 4:57 
GeneralRe: Static map Pin
HalfWayMan21-Feb-05 5:15
HalfWayMan21-Feb-05 5:15 
GeneralRe: Static map Pin
ralfeus21-Feb-05 6:02
ralfeus21-Feb-05 6:02 
GeneralRe: Static map Pin
ThatsAlok21-Feb-05 5:16
ThatsAlok21-Feb-05 5:16 
QuestionHow to change color of button text ? Pin
scanf21-Feb-05 4:06
scanf21-Feb-05 4: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.