|
Gerry Schmitz wrote:
Tying the validation to the button "click" ("record" validation) is a lot simpler than context / field validation. True, but that does not make it right.
Gerry Schmitz wrote:
In this case, he would have to "disable" the button (to "not allow a press"), then enable it when a selection was made. Which is extremely easy. A "balloon tip" on the OK button briefly telling why it is disabled makes it even more intuitive.
Gerry Schmitz wrote:
The more fields, the more "options", the more complex the enabling / disabling logic. Only if done incorrectly. Yes, a common approach is to sprinkle enable/disable code all over the place to do that very thing, but that's what adds unnecessarily complex (and possibly unmaintainable) code.
"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
|
|
|
|
|
I am trying to access of Google Chrome's web-page to read it and perform some actions for that I have to enable accessibility for chrome below is my sample code but it is not working for chrome.
IAccessible *pCAcc
..
...
IServiceProvider *pServProv = NULL;
pCAcc->QueryInterface(IID_IServiceProvider, (void**)&pServProv);
ISimpleDOMNode *pNode = NULL;
if (pServProv)
{
const GUID refguid = {0x0c539790, 0x12e4, 0x11cf, 0xb6, 0x61,
0x00, 0xaa, 0x00, 0x4c, 0xd6, 0xd8};
HRESULT hresult = pServProv->QueryService(refguid, IID_ISimpleDOMNode,(void**)&pNode);
//This QueryService call is failing for chrome browser. BUT but if install "FireFox
//browser " in my system this
// QueryService is working for chrome and firefox perfectly.
if (SUCCEEDED(hresult) && pNode != NULL)
{
//some code
}
}
What I have tried:
if install "FireFox browser " in my system this QueryService is working for chrome and firefox perfectly.
MY Question is :Is there a way to get it to work "chrome browser" without having firefox installed in my computer?
Can anyone explain what are that component or module or dlls are installed with FF browser.
|
|
|
|
|
|
Did you debug the code before and after you installed FireFox ? Maybe in this way you can know what exactly is not working in your code.
modified 25-Sep-19 7:08am.
|
|
|
|
|
Yes I debug the code when FF installed QueryService(...) is return success. if I uninstalled FF browser it returns fail "hresult = E_FAIL"
I am assuming some components or dlls are installing after FF browser installed so that chrome also working.
I want to know what dlls installing with FF browser
|
|
|
|
|
In this afternoon I can tell you a little software who can know what dll is installing on your PC when you install Firefox. I don't rememeber his name, but I have it at home.
|
|
|
|
|
The program that I am talking about is called RegShot[^], I haven't had it anymore, but as far I am see now, I don't know if it tell you about dll's, but you can retrieve valuable data when you install something, even Firefox.
Short documentation: How to Use Regshot To Monitor Your Registry[^]
|
|
|
|
|
In the blow code snippet, the DeleteColumn parameters takes 0 instead of "i" from the for loop. Why do we use 0 there and when I try using "i" there it didn't completely delete the column. I can't understand the process.
int nColumnCount = m_myListCtrl.GetHeaderCtrl()->GetItemCount();
for (int i=0; i < nColumnCount; i++)
{
m_myListCtrl.DeleteColumn(0); }
|
|
|
|
|
After you have deleted the column 0 the next column (the former column 1) becomes the column 0.
Another way to delete all the columns:
for (int i = nColumnCount - 1; i >= 0; i--)
{
m_myListCtrl.DeleteColumn(i);
}
|
|
|
|
|
Okay now I understand. Thanks 
|
|
|
|
|
I trying to put some custom functionality when x button is clicked for a specific dialog.
There is no cancel button in this dialog. What would be the best way to do this?
Thank you.
|
|
|
|
|
|
Thanks, this is exactly what I wanted. 
|
|
|
|
|
While OnClose() does get called when dismissing the dialog using the X or Alt+F4, it will not get called when dismissing the dialog using Esc or clicking the Cancel button (if one is present). This may not be an issue for your specific dialog, however.
"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
|
|
|
|
|
Can you handle the WM_CLOSE message ?
I'd rather be phishing!
|
|
|
|
|
Override the dialog's OnCancel() method.
"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
|
|
|
|
|
I'm trying to make something like this. In the edit control when I input some number other than the default number immediately some warning will be displayed.
e.g. there are 3 bottle which have the capacity of 1L, 2L & 3L resp. When I type 2 for the 1st bottle immediately I want to display warning message below.
I need some guidance to achieve this. Thank you.
P.s. I would be very grateful if some example is given. 
|
|
|
|
|
The same as the answer to your question below on validating edit controls.
|
|
|
|
|
|
in .h file :
afx_msg void MyDlg::OnEnChangeEdit();
in .cpp file :
BEGIN_MESSAGE_MAP(MyDlg, CDialogEx)
ON_EN_CHANGE(IDC_EDIT2, &MedicationDlg::OnEnChangeEdit)
END_MESSAGE_MAP()
void MyDlg :: OnEnchangeEdit()
{
CString temp;
updateData(TRUE);
temp = m_editvariable;
Function(1st parameter, temp) }
Thanks.
|
|
|
|
|
What kind of object is m_editvariable ?
|
|
|
|
|
I have edited like the below code. Only the first character I type shows in message box. What I wanted was the whole thing i type in the edit control.
eg. when I try to enter 300, the moment i type 3 message pop up with 3.
void MyDlg::OnEnChangeEdit()
{
CString temp;
m_Edit.GetWindowTextW(temp); MessageBox(temp);
Function(1st parameter, temp);
}
|
|
|
|
|
You can associate a CString value with your edit control, and there you will have entire edit value. VS wizzard allow you to do that.
|
|
|
|
|
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);
}
|
|
|
|