Home > Software engineering >  How to let a MFC control application work number is the only value?
How to let a MFC control application work number is the only value?

Time:11-17

as title

CodePudding user response:

The key in the map is the only one

CodePudding user response:

reference 1st floor qq_33462307 response:
the key in the map is the only
what key is the only in the map??????? This is static does not connect to the database. I'd like to know what code can let this I add personnel working only shall not repeat?

CodePudding user response:

refer to the second floor qq_40593968 response:
Quote: refer to 1st floor qq_33462307 response:

The key in the map is the only
what key is the only in the map??????? This is static does not connect to the database. I'd like to know what code can let this I add personnel working only shall not repeat? [/quot

You put the job number as the inside of the map key not to go? Do you know the type map

CodePudding user response:

reference qq_33462307 reply: 3/f
Quote: refer to the second floor qq_40593968 response:

Quote: refer to 1st floor qq_33462307 response:

The key in the map is the only
what key is the only in the map??????? This is static does not connect to the database. I'd like to know what code can let this I add personnel working only shall not repeat? [/quot

You put the job number as the inside of the map key not to go? Do you know the type map
well,,, is not very understand consult how to play,,

CodePudding user response:

Thinking now is to want to add the working and comparing existing work number, if there is how to do it, if there is no what to do,

CodePudding user response:

reference 5 floor qq_33462307 reply:
idea now is to want to add the working and comparing existing work number, if there is how to do it, if there is no what to do,

If (IsDlgButtonChecked (szEdit1))
GetDlgItem (szEdit1)=GetWindowText (szEdit1);
{
AfxMessageBox (" gonghaowu repeat do not create ");
return;
}
I can only so... And if it is wrong, I don't know what to write

CodePudding user response:

Need an array to record the program input so far all "gonghaowu",
When have a new job number input, the working status with all previous work number (i.e., the array), not equal, not equal in the array,

CodePudding user response:

The simplest approach is to iterate through the query time, have a duplicate.
Lazy way is to use the set or the map to preserve existing work number, can quickly determine whether there is any.

CodePudding user response:

refer to 7th floor schlafenhamster response:
need an array to record the program input so far all "gonghaowu",
When have a new job number input, the working status and all previous work number (i.e., the array), not equal, not equal in this array,


refer to the eighth floor xiaohuh421 response:
it is the most simple traversal query time, have a duplicate.
Lazy way is to use the set or the map to preserve existing work number, can quickly determine whether there is any.

Now I this is the beginning did not have any employees don't know how to use the set or the map to encapsulate the start working there is no job number lost in a great mess I don't know what method

CodePudding user response:

At first you don't, no, the set or the map is empty, of course, there will be no repetition.
Add a job number to judge the set or the map to have this job number, did not join the set/map

You really don't understand the set or the map, you can use a list to keep working, every time to add a new job number is first to determine whether a list the work number () does not exist in the list is empty, of course, work number.

This also don't understand, can only say that your program is no shape. The most basic logic

CodePudding user response:

refer to the original poster qq_40593968 response:
refer as title
map not understand it with the detailed points of the list of user identification (userid) with the order of the list to the corresponding user information (the userinfo) work number also direct reference list in the order of identity

CodePudding user response:

Need not to need continuity? GUID? Split second generation or by (date) (month) (year), as long as you don't change the time, will not repeat,
If it is a continuous sequence without database, then write the text record only honestly, additional records a last time the last number, then + 1 line,

CodePudding user response:

Simple point work number:
Use of CStringArray, look at the use of CStringArray,
CStringArray is empty at the beginning, after each legal working status (only) through the add to join

CodePudding user response:

You can write a class, properties including job number, name, gender, department, skills, and then use a CArray arrays with the class as the input and output, add the response function of the first things you set all read, whether array is empty, empty added directly, without an empty circular array and you just set the working compare, not equal to add,

CodePudding user response:

1. CStringArray m_array; Assume that the current working content stored in strEdit1;

//click add
OnAdd ()
{
int i=0;
Int nSize=m_array. GetSize ();
For (I=0; i {
If (strEdit1==m_array. GetAt (I)
AfxMessageBox (_T (" existing "));
}
}

2:
Int nCount=m_listCtrl. GetItemCount ();
For (I=1; i <=nCount; I++)
{
//for each job number in a list control, comparison,
//STR=m_listCtrl. GetItemText (I, 1);
If (strEdit1==STR)
AfxMessageBox (_T (" existing "));
}

CodePudding user response:

The building Lord, how can you still use VC6.0? The changed

CodePudding user response:

Upstairs are great, several methods of data bit stupid point, you can directly make a array, each adding a as the contrast in the array, there have been added, if already exist can not add, prompt gonghaowu repetition

CodePudding user response:

The compiler is true V587

CodePudding user response:

Data is a passer-by
The window is stranger b
The original poster is a passerby c

How much is your money not pocket b word

B just said out convenient c know on your fingers

CodePudding user response:

Do with sqlite database, work number query,

CodePudding user response:

Set
  • Related