Click here to Skip to main content
15,890,506 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Dynamic programming Pin
Stuart Dootson20-Feb-09 3:05
professionalStuart Dootson20-Feb-09 3:05 
AnswerNothing to see here, move along Pin
led mike20-Feb-09 4:27
led mike20-Feb-09 4:27 
QuestionHow to read a complete row. Pin
VC_RYK20-Feb-09 0:08
VC_RYK20-Feb-09 0:08 
AnswerRe: How to read a complete row. Pin
CPallini20-Feb-09 0:26
mveCPallini20-Feb-09 0:26 
QuestionAbout uses of RDLC in VC++.net 2005 Pin
ddgalande20-Feb-09 0:01
ddgalande20-Feb-09 0:01 
QuestionSerialize a variable length structure Pin
hatemtaleb19-Feb-09 23:30
hatemtaleb19-Feb-09 23:30 
AnswerRe: Serialize a variable length structure Pin
«_Superman_»19-Feb-09 23:35
professional«_Superman_»19-Feb-09 23:35 
AnswerRe: Serialize a variable length structure Pin
Stuart Dootson20-Feb-09 2:34
professionalStuart Dootson20-Feb-09 2:34 
The way it's usually done is something like this:

  • Read Len from whatever you're reading from
  • Allocate a buffer of size Len + sizeof Len bytes.
  • Copy Len into the first sizeof Len bytes of the buffer
  • Read Len bytes into the buffer after the copied value of Len
  • Cast the buffer pointer to FRAME* and return it


Let's presume you're reading from a C FILE:

FRAME* ReadFRAME(FILE* file)
{
   int Len;
   fread((void*)&Len, sizeof(Len), 1, file);
   char* space = (char*)malloc(Len + sizeof(Len));
   FRAME* gotFrame = (FRAME*)space;
   gotFrame->Len = Len;
   fread((void*)gotFrame->Text, 1, Len, file);
   return gotFrame;
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

QuestionHelp For NtDsAPI.Lib Pin
vijith.squadz19-Feb-09 22:41
professionalvijith.squadz19-Feb-09 22:41 
AnswerRe: Help For NtDsAPI.Lib Pin
«_Superman_»19-Feb-09 23:39
professional«_Superman_»19-Feb-09 23:39 
QuestionGDI+ DrawImage() Speed Issue Pin
Redeye9219-Feb-09 22:23
Redeye9219-Feb-09 22:23 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
frx9619-Feb-09 23:03
frx9619-Feb-09 23:03 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9219-Feb-09 23:11
Redeye9219-Feb-09 23:11 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
KarstenK19-Feb-09 23:21
mveKarstenK19-Feb-09 23:21 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9219-Feb-09 23:29
Redeye9219-Feb-09 23:29 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
KarstenK20-Feb-09 0:06
mveKarstenK20-Feb-09 0:06 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
Nishad S19-Feb-09 23:55
Nishad S19-Feb-09 23:55 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9220-Feb-09 0:15
Redeye9220-Feb-09 0:15 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Nishad S20-Feb-09 0:29
Nishad S20-Feb-09 0:29 
GeneralRe: GDI+ DrawImage() Speed Issue Pin
Redeye9220-Feb-09 0:54
Redeye9220-Feb-09 0:54 
AnswerRe: GDI+ DrawImage() Speed Issue Pin
Stuart Dootson20-Feb-09 2:40
professionalStuart Dootson20-Feb-09 2:40 
GeneralThe Solution Pin
Redeye9220-Feb-09 3:29
Redeye9220-Feb-09 3:29 
GeneralRe: The Solution Pin
micahferguson28-Feb-09 9:53
micahferguson28-Feb-09 9:53 
GeneralRe: The Solution Pin
Redeye921-Mar-09 21:46
Redeye921-Mar-09 21:46 
QuestionAttempting to get 'Desktop PIDL' on Win2k, Win98 - Bizarre behavior Pin
ab4rum19-Feb-09 21:03
ab4rum19-Feb-09 21: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.