Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: passing string as first parameter in sprintf Pin
Madhu Nair11-Nov-09 20:19
Madhu Nair11-Nov-09 20:19 
AnswerRe: passing string as first parameter in sprintf Pin
Vincen Wang11-Nov-09 22:13
Vincen Wang11-Nov-09 22:13 
AnswerRe: passing string as first parameter in sprintf Pin
suthakar5611-Nov-09 22:34
suthakar5611-Nov-09 22:34 
GeneralRe: passing string as first parameter in sprintf Pin
Michael Schubert11-Nov-09 22:48
Michael Schubert11-Nov-09 22:48 
QuestionRe: passing string as first parameter in sprintf Pin
David Crow12-Nov-09 5:21
David Crow12-Nov-09 5:21 
QuestionHow to hide ListBox Pin
Anu_Bala11-Nov-09 18:28
Anu_Bala11-Nov-09 18:28 
AnswerRe: How to hide ListBox Pin
KingsGambit11-Nov-09 18:38
KingsGambit11-Nov-09 18:38 
Questionneed help understanding udp packet code... Pin
homeboyimperial11-Nov-09 16:45
homeboyimperial11-Nov-09 16:45 
bool Message::unpack() {
      struct tuple{
            qint32 op;
            union {
                  qint32 val;
                  quint32 uval;
            };
      };

      changeByteOrder();

      //no data?
      if (data() == NULL)
            return false;
      //invalid header?
      if (*(qint32 *)data() != VALID_DGM)
            return false;
//<b>skip header--- here is my problem i need the source ip   </b>
   <b>   tuple *pt = (tuple *)(data() + 4); </b>  
      //reset active sensors
      actSens = 0;
      //read all sent values
      for (int i = 4; i &lt; size(); i+=sizeof(tuple)) {
            switch (pt-&gt;op) {
                  case OP_TSLEEP:
                              tsleep = pt-&gt;uval;
                              break;
                  case OP_TRECV:
                              trecv = pt-&gt;uval;
                              break;
                  case OP_ID:
                              id = pt-&gt;uval;
                              break;
                  case OP_TEMP:
                              temp = pt-&gt;uval;
                              actSens |= SENSOR_LINE_TEMP;
                              break;
                  case OP_AI0:
                              ai0 = pt-&gt;val;
                              actSens |= SENSOR_LINE_A0;
                              break;
                  case OP_AI1:
                              ai1 = pt-&gt;val;
                              actSens |= SENSOR_LINE_A1;
                              break;
                  case OP_AI2:
                              ai2 = pt-&gt;val;
                              actSens |= SENSOR_LINE_A2;
                              break;
                  case OP_DIO0:
                              dio0 = pt-&gt;uval;
                              actSens |= SENSOR_LINE_DIO0;
                              break;
                  case OP_DIO1:
                              dio1 = pt-&gt;uval;
                              actSens |= SENSOR_LINE_DIO1;
                              break;
                  case OP_DIO2:
                              dio2 = pt-&gt;uval;
                              actSens |= SENSOR_LINE_DIO2;
                              break;
                  case OP_DIO3:
                              dio3 = pt-&gt;uval;
                              actSens |= SENSOR_LINE_DIO3;
                              break;
                  case OP_CURRENT:
                              current = pt-&gt;uval;
                              actSens |= SENSOR_LINE_CURRENT;
                              break;
                  case OP_VOLTAGE:
                              voltage = pt-&gt;uval;
                              actSens |= SENSOR_LINE_VOLTAGE;
                              break;
                  case OP_VBATT:
                              vbatt = pt-&gt;uval;
                              actSens |= SENSOR_LINE_VBATT;
                              break;
                  case OP_RSSI:
                              rssi = pt-&gt;val;
                              actSens |= SENSOR_LINE_RSSI;
                              break;
                  case OP_LAST_ACK:
                              lastAck = pt-&gt;uval;
                              break;
                  default:
                              break;
                              //cout &lt;&lt; "UNKNOWN VALUE" &lt;&lt; endl;
                        }
            pt++;
      }
      return true;
}
i would like to not skip header so i can get source ip
QuestionSystem clock loses time and jumps back up Pin
sumeat11-Nov-09 13:23
sumeat11-Nov-09 13:23 
AnswerRe: System clock loses time and jumps back up Pin
Richard MacCutchan11-Nov-09 21:17
mveRichard MacCutchan11-Nov-09 21:17 
GeneralRe: System clock loses time and jumps back up Pin
sumeat12-Nov-09 7:57
sumeat12-Nov-09 7:57 
GeneralRe: System clock loses time and jumps back up Pin
Richard MacCutchan12-Nov-09 9:09
mveRichard MacCutchan12-Nov-09 9:09 
QuestionRe: System clock loses time and jumps back up Pin
David Crow12-Nov-09 5:23
David Crow12-Nov-09 5:23 
AnswerRe: System clock loses time and jumps back up Pin
sumeat12-Nov-09 7:52
sumeat12-Nov-09 7:52 
GeneralRe: System clock loses time and jumps back up Pin
Randor 12-Nov-09 12:21
professional Randor 12-Nov-09 12:21 
GeneralRe: System clock loses time and jumps back up Pin
sumeat12-Nov-09 14:23
sumeat12-Nov-09 14:23 
GeneralRe: System clock loses time and jumps back up Pin
Randor 12-Nov-09 15:20
professional Randor 12-Nov-09 15:20 
QuestionHow to hide a dialog box of another application completely ? Pin
hongheo7611-Nov-09 11:52
hongheo7611-Nov-09 11:52 
AnswerRe: How to hide a dialog box of another application completely ? Pin
«_Superman_»11-Nov-09 12:04
professional«_Superman_»11-Nov-09 12:04 
QuestionAdd dual COM interface to non-MFC application [solved] Pin
jmen@moc11-Nov-09 11:16
jmen@moc11-Nov-09 11:16 
AnswerRe: Add dual COM interface to non-MFC application Pin
Stuart Dootson11-Nov-09 11:41
professionalStuart Dootson11-Nov-09 11:41 
GeneralRe: Add dual COM interface to non-MFC application Pin
jmen@moc11-Nov-09 11:55
jmen@moc11-Nov-09 11:55 
AnswerRe: Add dual COM interface to non-MFC application [solved] Pin
«_Superman_»11-Nov-09 11:55
professional«_Superman_»11-Nov-09 11:55 
QuestionProgramatically change paper size during execution of PageSetupDlg Pin
hx200011-Nov-09 11:06
hx200011-Nov-09 11:06 
Question[Message Deleted] Pin
hunter12348311-Nov-09 9:26
hunter12348311-Nov-09 9:26 

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.