|
|
any sepcfic reason for doing it?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am using a radio button of type int.
If it is type int how can I disable/enable and hide it.
If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
I dont know how to do if it is of int type.
Thanks.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: I am using a radio button of type int.
I didn't get that point.
sunilkumar.d wrote: If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
You can disable radio buttons too by GetDlgItem().EnableWindow() . For instance,
GetDlgItem( IDC_RADIO1 )->EnableWindow( FALSE );
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
sunilkumar.d wrote: If it is type int how can I disable/enable and hide it.
If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
Radio Button is a window you can still use GetDlgItem().EnableWindow, Radio Button is not int type; as MFC allows DDX_Radio function that manages the transfer of int data between a radio control group and a int data member of the parent class it seems to you that Radio button is of int type.
|
|
|
|
|
Are you at work on a Saturday? If yes, do you work on all Saturdays? Or are you at home, lazing around your computer with coffee and snacks? That rocks man... Me at office right now, with lots of work to be done. We have a release on Monday.
(On the brighter side of it, the work is interesting and that keeps me going. )
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i tries to save my saturdays and sundays from work. wishes for successful release.
|
|
|
|
|
Thanks for the wishes man. I too try to separate work from my personal life. But, sometimes it just becomes impossible. [Me at office right now, am the only soul here, out of the 499 in this floor ]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi all,
i m new in database,i m using a SDI type appliaction in VC++ 2005, and MS-Access Datase through ODBC.
i m add class using MFC ODBC Consumer,and add desired database and its table for code.
By default it is derived from CRecordset. here GetDefaultConnect() for default connection and GetDefaultSQL() is present.
i want to know that in GetDefaultConnect() the connection string or path of database present, if i run my application on other computer then it gives an error, can i change the path in GetDefaultConnect(),
i dont knoe how can use it.
please tell me what string i pass in GetDefaultConnect() for execute my application properly for each computer.
Thanks in advance.
I m waiting for ur Valuable suggetions.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
If the connect string varies depending on location the app is running
from, then you need to provide the correct connect string instead of
hard-coding the string.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please tell me with example.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
GetDefaultConnect() is virtual. Simply derive a class from CRecordset
and override GetDefaultConnect() to return an appropriate string.
That's great for one recordset, but it's much easier to manage connections
with CDatabase - the class that actually represents the database connection.
You can have multiple connections (CDatabase Objects) so you can pool connections.
CDatabase MyDatabase;
BOOL ret;
try
{
ret = MyDatabase.OpenEx(myconnectionstring, CDatabase::noOdbcDialog);
}
catch(CDBException *e)
{
return;
}
if (ret && MyDatabase.IsOpen())
{
CMyRecordset myRecordset(&MyDatabase);
...
Data Source (ODBC)[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
how can we create HBITMAP handle from device context
Trioum
|
|
|
|
|
|
Is there any differences?
And which should be better?
|
|
|
|
|
Hi all,
my prob is quite simple but i didn't foud how to do it.
I have a FormView and i wanna put a CView area into that one to draw things.
How could i do it ?
Thank ya
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
|
Is there a way to retreive the data entered in a Edit Control Box while using a numerical Type variable? I've seen lots of examples that retreive the data when the variable Type is a CString, but none when it is numerical. In my dialog box I've got a Edit Control Box and I've added a variable of integer type so the number entered could be retreived without doing a conversion. But the value is always zero no mater what is entered. The following is some of the code:
Edit_Numbers_Dlg::Edit_Numbers_Dlg(CWnd* pParent /*=NULL*/)
: CDialog(Edit_Numbers_Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(Edit_Numbers_Dlg)
m_entered_number = 0;
//}}AFX_DATA_INIT
}
void Edit_Numbers_Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Edit_Numbers_Dlg)
DDX_Text(pDX, IDC_ENTERED_NUMBER_EDIT, m_entered_number);
DDV_MinMaxInt(pDX, m_entered_number, 0, 999999);
//}}AFX_DATA_MAP
}
void Edit_Numbers_Dlg::SearchNumbers()
{
for( int z=0; z<counter-1; z++="" )<br="" mode="hold"> {
if( oldnumbers[z] == m_entered_number )
found = 1;
}
}
|
|
|
|
|
hilop wrote: Is there a way to retreive the data entered in a Edit Control Box while using a numerical Type variable?
Yes. Use GetWindowText() , followed by atoi() .
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Isn't GetWindowText() and atoi() for string types?
|
|
|
|
|
Edit controls contain only text, thus to get an integer you must get the text and convert it.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Joe Woodbury wrote: only text, thus to get an integer you must get the text and convert it
Not true. If you work with a CEdit* and Get/SetWindowText then is ok what you say. But you can also associate a numeric member variable to the edit in the resource editor and it works as well.
HEADER
enum { IDD = IDD_MYFORMVIEW};
double m_dMyDouble;
CPP
void CMyFormView::DoDataExchange(CDataExchange* pDX)
{ CFormView::DoDataExchange(pDX);
DDX_Text(pDX, IDC_MY_EDIT, m_dMyDouble);
}
With this you will be able to work directly with numbers. And still more, if you make it like that, the edit will give you an error itself when you are introducing letters.
PS. This is under MFC (VC++ 6.0)
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
modified on Monday, June 2, 2008 10:37 AM
|
|
|
|
|
It's only text. MFC converts it to a numeric value, but the control stores only text. Next time, please actually look at what the source code is doing.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
From OP: Is there a way to retreive the data entered in a Edit Control Box while using a numerical Type variable?
Ok, it is the MFC who converts to numeric, but the OP is using MFC and having problems to associate the edit to a numeric variable... so the fact is, that he actually can do it.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|