|
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
|
|
|
|
|
You stated your member variables are m_Name and m_PhNumber.
Are those members of a dialog class, and associated with the controls through DDX?
If so, just set the appropriate member variable and let DDX update the control:
m_Name = namestringfromdatabasefield;
m_PhNumber = phonenumberstringfromdatabasefield;
UpdateData(FALSE);
Since you haven't shown any code you've tried, and there's many many ways to do this,
it's really hard to give you an example.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The application loading resources by reading files through a specific directory, say "source dir".
I can get "source dir" through Windows Registry.
Now, the user of the application asks for more resources, and hope the new resources can be installed easily.
Any way?
modified on Tuesday, April 22, 2008 5:35 AM
|
|
|
|
|
What?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
How to do this:
1. pack files in an installation file.
2. when executing the installaion file, it can find a direcotry to extract to in the registry first, then extract to that directory.
WinRAR can do most of this, but can't decide which directory to extract to automatically.
|
|
|
|
|
What exactly are you asking?
"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,
I'm developing in MS Visual Studio 6.
There are several #defines for pointer access, which are nested.
Example:
<br />
#define TVDVT(ii) tvd_ptr->tvdvt[ii]<br />
#define BSSTAMM(ii) (*(TVDVT(ii).stamm_ptr->bs_ptr))<br />
When debugging code like
ibs = bsindex (&BSSTAMM (ivt),bvd_ptr,tvd_ptr->tech_ptr);
it would be nice to get a quickwatch of BSSTAMM(ivt) w/o manually solve out all the #defines.
Is there any possibility to solve the problem (settings, tools, addins, ...)?
Thanks for help.
|
|
|
|
|
What about refactoring?
I.e. do you really need such macros?
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 am working on a COM Dll.In this Dll, there is an rich edit control in it where user type phonetic typing in hindi .
Now i am enhancing it by implemeting hindi suggestion list appear when user type words. Suggestion list comes from server and it is working fine.My issue is that in debug mode, after some time my application crashes but in release mode it is working fine.
Any help !!
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Well, you're in luck - it's much easier using a debugger in debug mode to see where the crash is, and why it's crashing.
Bad information?
Code that is called in debug mode, not release mode? (ie, non trivial ASSERTs).
Err, probably more.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi Iain ,
Thanks for reply.I debug it and not found any crash and my application is not crashes after executing but It crashes randomly. There is no issue of memory loss.
I think now i m clear.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Is your application logging everything? Can you try analyzing the log file?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello Rajesh,
I am not generating any log file now but i think it is the way to find out where the crash is...
thanks
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Alternatively, you could use a debug output monitor such as DebugView[^].
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|