Home > Software engineering >  I write in VS2015 C use MFC, how always tip try reference deleted function?
I write in VS2015 C use MFC, how always tip try reference deleted function?

Time:11-12

I write c + + in VS2015 use MFC, how always tip try reference deleted function? Location: here the union Uip
{
Int ud_ip;
Cstrings ub_ip;
Cstrings uy_u;
} udate;
The source code is as follows:
The union Uip
{
Int ud_ip;
Cstrings ub_ip;
Cstrings uy_u;
} udate;
Void CMFCApplication1Dlg: : OnBnClickedChange ()
{
Int c=0;
Int cc;
Cstrings aa;
Cstrings yy.
Udate. Ud_ip=128;
The switch (c)
{
Case 0:
The UpdateData (true);
Cc=udate. Ud_ip;
Dip=cc;
The UpdateData (false);
break;
Case 1:
The UpdateData (true);
Udate. Ub_ip="1000100";
Aa=udate. Ub_ip;
BJP=aa;
The UpdateData (false);
break;
Case 2:
The UpdateData (true);
Udate. Uy_u="FSFHSL";
Yy=udate. Uy_u;
Yu=yy.
The UpdateData (false);
break;
}
c++;
C %=3;
}

CodePudding user response:

The union Uip
{
Int ud_ip;
Cstrings ub_ip;
Cstrings uy_u;
} udate;
This is to do?

CodePudding user response:

Union, it's not reasonable to use cstrings here
Try to char array

CodePudding user response:

With the union to output different text box of the different types of values, is to know about the role of the union

CodePudding user response:

Put objects in the union is the first time in my life I see,

CodePudding user response:

"Depth explore c + + object model"
"C + + the disassembly and reverse analysis reveal"

CodePudding user response:

quoted zhao 4, 4/f, the teacher's reply:
put objects in the union is the first time in my life I see,

I am just learning, don't understand, can't put objects in the union? What is the meaning of this

CodePudding user response:

The
reference 1/f, cherish life away from the CPP response:
union Uip
{
Int ud_ip;
Cstrings ub_ip;
Cstrings uy_u;
} udate;
This is to do?

This is the following to the assignment, the data from the output

CodePudding user response:

The use of objects in the union is wrong, because the object is not a memory

CodePudding user response:

refer to the eighth floor zhao4zhong1 response:
using the object in the union is wrong, because the object is not a memory

Refer to five floor,

CodePudding user response:

reference 4 floor zhao4zhong1 response:
put objects in the union is the first time in my life I see,

C + + 11 o can be Unrestricted unions

CodePudding user response:

references to the tenth floor akirya response:
Quote: refer to 4th floor zhao4zhong1 response:

Put objects in the union is the first time in my life I see,

C + + 11 o can be Unrestricted unions

Higher position,

CodePudding user response:

 
The union Uip
{
Int ud_ip;
Cstrings ub_ip;
Cstrings uy_u;
} udate;

This can actually make into structure,
 
Struct Uip
{
ULONG ulType;
Int ud_ip;
Cstrings ub_ip;
Cstrings uy_u;
} udate;

According to ulType Settings, read the corresponding member,
Class, of course, also can make it,
COM VARIANT is so dry,

CodePudding user response:

Recommended to view the structure of the VARIANT in the MSDN. There were a variety of types, how to use the union

CodePudding user response:

reference 13 floor zjq9931 reply:
recommended to check the VARIANT in the MSDN structure, there are a variety of types, how to use the union

Thank you, I have a try, but I can just have to char

CodePudding user response:

Consult CMap usage:
https://editor.csdn.net/md/? ArticleId=105908977,

CodePudding user response:

The union is only a memory, he can be regarded as one of the types
  • Related