Home > Software engineering >  The value of the variable in the MFC debug do not agree with the values in the output to the dialog
The value of the variable in the MFC debug do not agree with the values in the output to the dialog

Time:09-26



Code:
HANDLE gets=NULL;
HBLUETOOTH_DEVICE_FIND HBDF=NULL;
BLUETOOTH_FIND_RADIO_PARAMS BTFRP={sizeof (BLUETOOTH_FIND_RADIO_PARAMS)};
BLUETOOTH_RADIO_INFO bri={sizeof (BLUETOOTH_RADIO_INFO)};
BLUETOOTH_DEVICE_SEARCH_PARAMS BTSP={sizeof (BLUETOOTH_DEVICE_SEARCH_PARAMS)};
BLUETOOTH_DEVICE_INFO btdi={sizeof (BLUETOOTH_DEVICE_INFO)};
HBF=BluetoothFindFirstRadio (& amp; BTFRP, & amp; Six HBR);

# if 0
DWORD I=100;
Int Item=_clistCtilValue. GetItemCount ();

C.F ormat (_T (" % d: ", I));

_clistCtilValue. SetItemText (Item, 1, c);

SetDlgItemText (IDC_EDIT1, c);
# endif
If ((ERROR_SUCCESS==BluetoothGetRadioInfo (gets, & amp; Bri)))
{
Int Item=_clistCtilValue. GetItemCount ();

If # 1
AddrLog. The Format (_T (" % % % 02 x: 02 x: 02 x: x % 02:02: x % % 02 x_ % x: ", btdi. Address. RgBytes [0], btdi. Address. RgBytes [1], btdi. Address. RgBytes [2], btdi. Address. RgBytes [3],
Btdi. Address. RgBytes [4], btdi. Address. RgBytes [5], btdi. Address. UllLong));
#endif

CodePudding user response:

Supplement: the development environment is VS2013

CodePudding user response:

Don't rely on the debugger output complex data structure. And complex data structures to the entire content of every step of the process it using a small piece of code is easy to understand by yourself the format of the output, help to debug very much! Or can be said to be "infrastructure"

CodePudding user response:

So you can see the change of each variable, only the results of this code on the VS2010 output is normal, but not what I want on VS2010 lib, took the lib to V2013 compiled on will be less need to compile the header file, the Internet is also suggest using V2012 later, a great god can give me a advice? I really don't see the problem?

CodePudding user response:

Local variables in the view of bri, output is btdi

CodePudding user response:

Thank you very much, he did not see clear, careless!

CodePudding user response:

CodePudding user response:

CodePudding user response:

reference 5 floor u010750821 reply:
thank you very much, he did not see clearly, careless!

About whether he is suitable for programming is very simple test:
On a newspaper or magazine articles, for a period of about 1000 words in Word input again, after losing to refer to the following answer:

A. there are more than 10 words or punctuation
B there is no words or punctuation mistakes and dare to bet for this
No words or punctuation errors and C fonts and layout fully consistent with the original
D print on the translucent paper and check the same original overlap, and feel very with a sense of accomplishment

A is not suitable for programming (reason: typing accuracy is low, careless)
B junior programmer (reason: typing accuracy high, careful and meticulous, confident, understand the whole Angle of half Angle concept)
C senior programmer (reason: in the B on the basis of understanding the font and layout is also an important factor of computer to print, but compared to D paranoid enough, strives for perfection, the results can verify)
D software project manager (reason: to be able to give convincing for project detailed requirements to the pole and typical test cases, users almost pick is not at fault, major!)

If want to from A to B, to my resources http://download.csdn.net/detail/zhao4zhong1/4084259 download "for programmers keyboard practice"
  • Related