|
Hi,
I want to validate a CEdit control in a property page, I use CEdit::OnKillFocus event. when the user switches to another page ane the contents are invalid I need to force the property sheet to return to the page that includes the invalid data, so how can this be done??
plus, is there a special place (OnValidate) to place my code in instead of placing validation code in KillFocus event???
thanx alot
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
You can handle validations in CPropertyPage::OnKillActive .
|
|
|
|
|
you now a faster way to search into a database ?
this is my code :
void CNcontabile::OnChangeName()
{
CString sCod ;
m_city.GetWindowText(sCod);
CDatabase_Mag* pMag = new CDatabase_Mag();
pMag->SetRowsetSize(25);
if (!pMag->Open())
return;
if (pMag->IsOpen())
{
while(!pMag->IsEOF())
if( sCod == pMag->m_mag)
{
m_name.SetWindowText(pMag->m_den);
}
}
pMag->Close();
}
m_name = CEdit;
m_city = CEdit;
-- modified at 5:20 Tuesday 19th September, 2006
Bravoone
|
|
|
|
|
Yes- you're searching in memory, after reading it all. You need to create a SQL query that returns only the data you're looking for.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
can you give me an example ? ( in my code please!)
Bravoone
|
|
|
|
|
SELECT select_list FROM table_source WHERE search_condition
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
David has given you a generic select statement. We can't do more than that because
a - we don't know your SQL schema ( or even what sort of DB it is )
b - we can only guess as to what classes you're using for database connectivity.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
My database come from another computer on the network i call it server .
some info about my database :
name : CDatabase_Name ;
type : snapshot ;
i have 3 columns : m_name , m_city , m_country;
my database have 250.000 records .
all i want is to search in to it for strings for example :
i have 3 CEdit . From CEdit1 i have onChange , i want to search from CEdit1 in m_name and if is found the data from database lets say from m_city to be in CEdit2 like ---my code "loop"!--- but i want to be a fast search !!!!
please help me ! i will wait your answer !!!!!!!
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: My database come from another computer on the network i call it server .
This tells me nothing.
Flaviu_2006 wrote: name : CDatabase_Name
Flaviu_2006 wrote: i have 3 columns : m_name , m_city , m_country;
Are those REALLY database names, or are they field names in your code, which have been auto generated for you ?
Flaviu_2006 wrote: but i want to be a fast search !!!!
Do you know what SQL is ? Do you know what technology you're using to connect to your database ? Do you know what sort of database it is ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I have used the following code to display the text in edit box and a combobox respectively.
How can I get the data from these controls.
CEdit *Display;
Display = reinterpret_cast<cedit *="">(GetDlgItem(IDC_EDITCAMPAIGNID));
Display->SetWindowText("tejaswini");
CComboBox *Combo;
Combo = reinterpret_cast<ccombobox *="">(GetDlgItem(IDC_COMBOFORMAT));
Combo->SetWindowText("shilpa");
Combo->AddString("Radhika");
Combo->AddString("Lakshmi");
But when i executed the program I am getting only "Lakshmi" in the dropdown list.How can I get "Radhika" also in the drop down list.
Can u plz help me.
Thanks in advance.
|
|
|
|
|
|
Flaviu_2006 wrote: Re: How to get the data from edit control
or if you have the id of the edit control and no variable associated to it...
GetDlgItemText()
or use SendMessage() etc...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
ID of the edit control is IDC_EDITCAMPAIGNID
Plz can you show the code fot it.
|
|
|
|
|
tejaswini.g wrote: Re: How to get the data from edit control
char *str=new char[10];
GetDlgItemText (IDC_EDITCAMPAIGNID,str,10);
AfxMessageBox (str);
delete[] str;
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
if you have a variable of CEdit you can use from it m_Edit.GetWindowText(...); if you have ID of control you can use GetDlgItemText for text and GetDlgItemInt for number
|
|
|
|
|
_AnShUmAn_ wrote: char *str=new char[10];
Why suggest this when CString is preferable? Allocating memory is expensive. Unnecessarily interacting with the memory manager is just asking for trouble.
Had you used a CEdit member variable, one line of code would be all that's necessary.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tejaswini.g wrote: Combo->AddString("Radhika");
Combo->AddString("Lakshmi");
But when i executed the program I am getting only "Lakshmi" in the dropdown list.How can I get "Radhika" also in the drop down list.
Are you sure, its not getting added?.I dont see any problem with code.
|
|
|
|
|
Sorry , In the properties I have selected NO integral height now and now I am getting the result.
Thank you.
|
|
|
|
|
hi all,
I have a requirement of adding a hyperlink (basically a URL say "www.google.com")
to my dialog box. could anyone guide me as to how i can do that?
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: I have a requirement of adding a hyperlink (basically a URL say "www.google.com")
to my dialog box. could anyone guide me as to how i can do that?
Search CP with the keyword Hyperlink control, you are sure to get plenty.
|
|
|
|
|
|
|
|