Click here to Skip to main content
14,868,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to determine file offset of each section using RVA in pe file ? Pin
Richard MacCutchan31-May-16 2:00
mveRichard MacCutchan31-May-16 2:00 
AnswerRe: How to determine file offset of each section using RVA in pe file ? Pin
Bram van Kampen1-Jun-16 15:11
MemberBram van Kampen1-Jun-16 15:11 
QuestionCopy certain member variable data of a structure Pin
manoharbalu30-May-16 23:45
Membermanoharbalu30-May-16 23:45 
AnswerRe: Copy certain member variable data of a structure Pin
Richard MacCutchan31-May-16 0:31
mveRichard MacCutchan31-May-16 0:31 
GeneralRe: Copy certain member variable data of a structure Pin
manoharbalu31-May-16 0:40
Membermanoharbalu31-May-16 0:40 
GeneralRe: Copy certain member variable data of a structure Pin
Richard MacCutchan31-May-16 0:47
mveRichard MacCutchan31-May-16 0:47 
AnswerRe: Copy certain member variable data of a structure Pin
Jochen Arndt31-May-16 1:43
professionalJochen Arndt31-May-16 1:43 
AnswerRe: Copy certain member variable data of a structure Pin
leon de boer31-May-16 3:59
Memberleon de boer31-May-16 3:59 
EDIT: LOL hadn't read Jochen's response who did it same way but with some nice protocol sizing. That is pretty nice makes the case statements on the copy enumerate easier. Anyhow you get the idea it isn't a hard task. I will leave the code so you can see what his protocol sizing is simplifying. Did you ever get the network transfer sorted?

Like the people said whats the problem?
You can just do as basic as memcpy I just grabbed your struct and made a zeroed instance and did it to show you.

struct TModDB MyModDB = { 0 };
float DupFXS[30][60];
memcpy(DupFXS, MyModDB.FXS, sizeof(DupFXS));

Really as a commercial thing I would make an enumerator and a single function to copy whatever field I pass the enumerate of or if I can use C++ make it a class or object.

The C enumerate option looks something like follows, your job is to provide a buffer and it's size to the function for the field you are copying
enum DBENUM {
  DE_IVKK = 0,
  DE_FIL,
  DE_FDDD,
  DE_FCDCP,
  DE_FLH,
  // blah blah blah
};

BOOL DBCopyFunction (enun DBNUM whatToCopy, struct TModDB* TheDB, void* Buf, long SizeOfBuf){
   BOOL success = FALSE;    // Preset fail .. any errrors we will let drop thru
   if (TheDb){              // Check theDB ptr valid
      switch(whatToCopy){
          case DE_IVKK: {
              if (sizeof(TheDB->IVKK) <= SizeofBuf) {             // check buffer large enough
                   memcpy(Buf, TheDB->IVKK, sizeof(TheDB->IVKK)); // Copy IVK field
                   success = TRUE;                                // Field copied set success
              }
          }
          break;
          case DE_FIL: {
              if (sizeof(TheDB->FIL) <= SizeofBuf) {             // check buffer large enough
                   memcpy(Buf, TheDB->FIL, sizeof(TheDB->FIL));  // Copy FIL field
                   success = TRUE;                               // Field copied set success
              }
          }
          break;

          /// blah blah blah
      }
   }
   return (success);
} 


There isn't anything complicated that it's just a large complex structure.
In vino veritas


modified 31-May-16 10:28am.

GeneralRe: Copy certain member variable data of a structure Pin
manoharbalu1-Jun-16 2:25
Membermanoharbalu1-Jun-16 2:25 
GeneralRe: Copy certain member variable data of a structure Pin
Bram van Kampen1-Jun-16 15:51
MemberBram van Kampen1-Jun-16 15:51 
GeneralRe: Copy certain member variable data of a structure Pin
manoharbalu1-Jun-16 20:02
Membermanoharbalu1-Jun-16 20:02 
GeneralRe: Copy certain member variable data of a structure Pin
leon de boer1-Jun-16 20:18
Memberleon de boer1-Jun-16 20:18 
GeneralRe: Copy certain member variable data of a structure Pin
leon de boer2-Jun-16 19:31
Memberleon de boer2-Jun-16 19:31 
QuestionRe: Copy certain member variable data of a structure Pin
David Crow31-May-16 5:07
MemberDavid Crow31-May-16 5:07 
QuestionC++ Smartphone application, get data from MySQL Pin
PonSvens29-May-16 10:04
MemberPonSvens29-May-16 10:04 
AnswerRe: C++ Smartphone application, get data from MySQL Pin
CPallini29-May-16 20:58
mveCPallini29-May-16 20:58 
AnswerRe: C++ Smartphone application, get data from MySQL Pin
leon de boer29-May-16 22:53
Memberleon de boer29-May-16 22:53 
AnswerRe: C++ Smartphone application, get data from MySQL Pin
Richard MacCutchan30-May-16 1:16
mveRichard MacCutchan30-May-16 1:16 
GeneralRe: C++ Smartphone application, get data from MySQL Pin
leon de boer30-May-16 2:43
Memberleon de boer30-May-16 2:43 
GeneralRe: C++ Smartphone application, get data from MySQL Pin
Richard MacCutchan30-May-16 3:02
mveRichard MacCutchan30-May-16 3:02 
GeneralRe: C++ Smartphone application, get data from MySQL Pin
David Crow30-May-16 5:04
MemberDavid Crow30-May-16 5:04 
Question8Puzzle game Pin
Abdulrahman Mostafa24-May-16 16:31
MemberAbdulrahman Mostafa24-May-16 16:31 
AnswerRe: 8Puzzle game Pin
Richard MacCutchan24-May-16 21:56
mveRichard MacCutchan24-May-16 21:56 
QuestionRe: 8Puzzle game Pin
David Crow25-May-16 4:34
MemberDavid Crow25-May-16 4:34 
QuestionEdit Subitems In Owner Drawn List Pin
DanYELL23-May-16 4:58
MemberDanYELL23-May-16 4:58 

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.