|
Could you give an example. Thanks
|
|
|
|
|
In header:
public:
enum { IDD = IDD_TEST_FORM };
CEdit m_Edit1;
CString m_sEdit1;
in cpp:
void MyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT1, m_Edit1);
DDX_Text(pDX, IDC_EDIT1, m_sEdit1);
}
so you have the value of edit control inside of m_sEdit1.
Example:
void MyDlg::OnEnchangeEdit()
{
updateData(FALSE);
Function(1st parameter, m_sEdit1);
}
|
|
|
|
|
Thank you . The example really really helps. 
|
|
|
|
|
Member 14575556 wrote:
m_Edit.GetWindowTextW(temp); Why not just use GetWindowText() ?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
It was a typo. I've changed it. Thanks 
|
|
|
|
|
Use 3 radio buttons; default select the first option (1L).
Or leave it "empty" (tri-state) and warn if no selection made.
Standard stuff that everyone recognizes.
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Initially I put my button as GetDlgItem(IDC_MYBUTTON)->ShowWindow(FALSE).
What I wanted to do is when I select one of the rows in the list view control, I wanted to make my button display on the dialog or visible.
What will be the best way to achieve this. I would like to receive some guidance.
Thank you.
|
|
|
|
|
You could handle TVN_SELCHANGED message from your list control, check whether some item in list control is selected and if it is then show your button, otherwise hide it
|
|
|
|
|
Could you give one example as an explanation.
Thanks.
|
|
|
|
|
|
Thank you so much for the example 
|
|
|
|
|
Hello everyone,
I'm trying to validate user input entered in Edit control. When it is empty or user enter invalid input or enter input that is not in the database to display some message saying "invalid input" right under the edit control box as a text.
What will be the best way to do this. Any suggestions?
Thanks in advance. 
|
|
|
|
|
|
Thank you 
|
|
|
|
|
There are 2 schools of thought on how to do it.
- Do it "live" as the user types in value (mostly with the EN_CHANGE message); each time the user types something, use GetWindowText and start searching the Database; this is somewhat complicated as the search can take a long time compared to the speed the user types (you would need some way to stop the current search and start a new one each time a new character is typed in); warn the user with visual feedback (red highlights while the input is not valid.
- Do it when the user clicks on the "ok" (or "search") button; on the OnOK (or "search") , get the full string with GetWindowText and do some validation and search the Database; easier to implement, you can just wait for the whole search to be done and warn user after with a simple SetWindowText to your static control (or edit control) that will display the error.
Personally, I would do "2" it is simpler and quicker (unless there is a requirement to do live input validation).
I'd rather be phishing!
|
|
|
|
|
Thank you. I'm doing the 2nd step too.
One more question I want to show the button only when I select any one row in the list view control. What will be the best way to do this.
Thanks again.
|
|
|
|
|
|
|
I have a file under Program Files (x86) called pdf995.ini and
I want to programmatically edit this file. Sometimes I can make
the software edit this file but many times it doesnt work. I know
this file requires permission to change. Is there a way to open
this file and overwrite this file? Please let me know.
|
|
|
|
|
Perhaps, if you logged in as Admin...
|
|
|
|
|
If it "sometimes" works, then "file replace" usually always works.
ReplaceFileA function (winbase.h) | Microsoft Docs
The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.'
― Confucian Analects
|
|
|
|
|
Erich Ruth wrote: Sometimes I can make
the software edit this file but many times it doesnt work. You'll need to narrow this down. Once that happens, then you can starting working on a coding solution.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Then you need to move it to a location that is not protected. Neither Program Files nor Program Files (x86) should be used for files that may need updating at run time.
|
|
|
|
|
I have created 3 dialog:
1st dialog has a search functionality where I can search and the result will be displayed in the list view control the data present in the database.
when select one row and click button it will take me to another dialog listing the details of the selected in the list view control. Similarly when I select one item displayed in the 2nd dialog list view control ,it will take me to another where I can change the details of the 2nd dialog and when click save, it will close the current dialog and update the list view control with the updated data.
This is what I was trying to do but I'm getting problem when I clicked save, It is updated in the database and got a breakpoint in vs2015. I need some assistance. Please help.
Thanks.
|
|
|
|
|
We cannot help without seeing the code and the error details.
|
|
|
|