|
prasad_som wrote: CButton *pBtns = new CButton[nNumOfPorts];
pBtns->Create(....using radio button style);
That is wrong.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
I suggest you to suggest him ( ) the final cleanup too. Do you know, when dealing with dynamic allocation, newbies tend to forget it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
He/She has not replied to my reply, obviouslu he has not followed m answer.
|
|
|
|
|
Who knows, maybe he silently has.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
In the same way as you would any other button, just use the BS_RADIOBUTTON style.
"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
|
|
|
|
|
<br />
int i = 10;<br />
int k = 100;<br />
switch(i)<br />
{<br />
case 0:<br />
cout << "case 0" <<endl;<br />
break;<br />
if(k == 100)<br />
{<br />
case 10:<br />
cout <<"The device type is 100 so attribute 10 is valid"<<endl;<br />
break;<br />
}<br />
else<br />
{<br />
case 100:<br />
cout <<"attribute 100 is there" << endl;<br />
break;<br />
}<br />
break;<br />
default:<br />
cout <<"default"<<endl;<br />
}<br />
Please confirm whether 'if' could be placed inside a switch statement.
Pratap
|
|
|
|
|
a. yes
b. no
c. maybe
d. none of the above
codito ergo sum
|
|
|
|
|
Thanks for the reply. Please post your choice.
|
|
|
|
|
Is this a real question? or you are new to c++?
|
|
|
|
|
I'm not new to C++ . Today I had to write some code which includes swith cases, but case lables are valid in only some conditions (depending on the device type). I was not completly sure that the code is invalid, and wrote a test pgm in vs2k3, and it worked fine. Before checking in, wanted a confirmation.
|
|
|
|
|
Raj Prathap wrote: Please confirm whether 'if' could be placed inside a switch statement.
and the reason behind this doubt for not using an 'if' in a switch block is ... !!!
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Raj Prathap wrote: Please confirm whether 'if' could be placed inside a switch statement.
Yes. But compile the following code and you'll know how much the compiler 'cares' about the IF statement.
int i=4;
switch(i)
{
if(false)
{
case 4:
AfxMessageBox("Whack my head with that oldskool keyboard");
break;
}
}
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rutherford would say: "the switch statement targets its case condition passing the if block like as if you fired a 15-inch shell at a piece of tissue paper"
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Is it the encrypted version of some nice piece of code?
BTW on my system (VS2005) it compiles, but at runtime the switch condition overrides (breaks ) the if one: is it what you're expecting?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
yeah, it was encrypted with 128bit RSA algo. Its great that you could decrypt it .Just kidding..
Its neither encrypted nor a question from an interview. I had to write some code today and I re written the code in different way also. But I gor a doubt if this code is valid and wanted a confirmation.
|
|
|
|
|
The code compiles. But I doubt it works as you expect (i.e. avoid such misleading constructs).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Raj Prathap wrote: Please confirm whether 'if' could be placed inside a switch statement.
Why would you go to all the trouble of creating this post when you could have just compiled it to find out?
"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
|
|
|
|
|
Hi EveryOne,
I am savitri here.I am using ODBC in VC++ programs.I am Inserting values in the tables.If i want to Edit/Update Those values how Can I do it.if i clicked on the values those are come on the text boxes in that i want to edit after clicking button those values should be updated.Please tell me How can i Do it.
I am not getting idea how to get back the values on text boxes.
PLEASE HELP ME.
THANKS IN ADVANCE,
savitri
|
|
|
|
|
Use SQL queries to edit/modify/delete/update your textbox values. you have to update your database through SQL UPDATE statement. Like:
<br />
UPDATE table<br />
SET column = expression<br />
Mukesh Kumar
Software Engineer
|
|
|
|
|
Are you using MFC?
"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
|
|
|
|
|
savitri wrote: I am not getting idea how to get back the values on text boxes.
You can use the GetWindowText() function or send a WM_GETTEXT message to the controls.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
ya i am using MFC.Please tell me how shall i use that GetWindowText() function.My Member VAriable names are m_Name and m_PhNumber and in database my fields are Name and PhoneNumber.
So PLEASE TELL ME USAGE OF THAT FUNCTION AND WHEN I CLICKED ON DATA I WANT GET THAT INTO MY TEXT BOXES.PLEASE HELP ME.
THANKS IN ADVANCE,
savitri
|
|
|
|
|
I'm not sure what you're looking for here...
If you have the data from a field of a record from the database, then
copy that data as text to the edit control.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi everyone,
i am storing the values in my table called address book.at the time of update or edit a particular data i want the selected data on the edit boxes. so please tell me how can i get the data from the table into the text boxes.PLEASE REPLY ME.HELP ME SOON.
Thanks in Advance,
savitri
|
|
|
|