|
This is a complete strawman - the exception you're throwing is derived from std::exception so the first catch clause I wrote would have caught it.
|
|
|
|
|
Aescleal wrote: This is a complete strawman - the exception you're throwing is derived from std::exception so the first catch clause I wrote would have caught it.
You seem to be missing the point. The choice of exception was arbitrary, the point is that it's not expected. Sure the first catch in your code would have caught it, but there is no such beast in the code I posted. My code is different to yours; you seem to be misrepresenting my argument. Who's augment is the straw man? You asked me to elaborate on my position and I did: instead of the user getting a generic error message (of no use to anyone) I get a dump file. I prefer the latter.
Steve
|
|
|
|
|
Stephen Hewitt wrote: crashing is a feature.
and I provide that feature absolutely free with no hidden costs in all of my products.
|
|
|
|
|
One open source project whose author knows about try..catch blocks is this:
1. http://freshmeat.net/projects/ecasound[^]
check ecasound-2.7.1\ecasound-2.7.1\Documentation\programmers_guide\ecasound_programmers_guide.txt
(use of EH is very minimal here ut at least it exists)
I will add more projects as and when I find them... have installed a catch(...) for all future source code checks.
modified on Tuesday, June 29, 2010 9:21 AM
|
|
|
|
|
Hello all
I've implemented a class dervied from CRecordset.
this class gets the DB and sql query and retrives data.
everything was working fine, untill i've decided to delete the data directly from the DB.
when i'm running the same code, the class retrives the same data, although the data is erased.
what's the problem ??
CSpecificGraphsRS rsSpeGraphs(&m_db);
strQuery.Format("SELECT * FROM GRAPHS ORDER BY GRAPH_ID");
rsSpeGraphs.Open(CRecordset::snapshot, strQuery, CRecordset::none);
while (!rsSpeGraphs.IsEOF())
{
genGraphDisplay.strGraphId = rsSpeGraphs.m_GRAPH_ID;
}
|
|
|
|
|
Did you make sure your program is accessing the same database that you directly deleted data from? Sometimes multiple test databases are used and the wrong one may be modified, making you believe that the program is not working.
|
|
|
|
|
yes i did,
they access the same DB.
|
|
|
|
|
Are the records in the set truly deleted? Try:
while (! rsSpeGraphs.IsEOF())
{
if (rsSpeGraphs.IsDeleted())
TRACE(_T("Recod is deleted.\n"));
rsSpeGraphs.MoveNext();
}
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
HI,
What is pure virtual destructor?
what is the use of using pure virtual destructor ?
Thanks,
Krish.
|
|
|
|
|
See, for instance, the competitors...[^].
Personally, I think you should always use virtual destructors. No need to have pure virtual destructors (see [^]).
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
[My articles]
|
|
|
|
|
|
A pure virtual destructor is any destructor marked as virtual with = 0 after it's signature, e.g:
class T
{
public:
virtual ~T() = 0;
};
Making a destructor pure virtual means very little more than making the destructor virtual (and you do that to make sure the correct destructor is called when you delete an object through a base class pointer). The additional bit is that it means the derived class has to define it's own destructor and not rely on the base class one.
One additional wrinkle is that all pure virtual destructors have to have an implementation, unlike normal pure virtual member functions which don't have to have one.
Cheers,
Ash
|
|
|
|
|
Hi,
I have developed and application based on modeless dialogs (the view is a formview and the others are CDialog and I show and hide them as corresponds). But I have a problem because when a modeless dialog has the caption, the mainframe loses it and I cannot access to the menu and toolbar from acceleratos because they don't have the caption.
How could I keep always caption on the mainframe? Maybe all dialogs can be defined as formview?
Thank in advance
|
|
|
|
|
Don't make the dialog a child of your main window, set its parent window to NULL. In that way it will be a child of the desktop and will not take the focus from your main window.
It's time for a new signature.
|
|
|
|
|
Or you can leave it like child of your window and put return FALSE in OnInitDialogfunction
|
|
|
|
|
What?
It's time for a new signature.
|
|
|
|
|
Hi,
Thank you for your help, but unfortunately it didn't work.
I set:
BOOL CDlgListaPt::Create()
{
return CDialog::Create(CDlgListaPt::IDD);
this->SetParent(NULL);
}
and also tried in Oninitdialog method but the mainframe lose caption
my dialog is a popup non-modal dialog that is created from the view (what is a formview)
If I change the dialog style to child, the mainframe keeps caption but I cannot control de dialog.
The other solution returning false in oninitdialog it didn't work either.
Regards
|
|
|
|
|
how many threads can possibly be made in a program please explian launguage wise
|
|
|
|
|
CreateThread documentation [^], Remarks section:
The number of threads a process can create is limited by the available virtual memory. By default, every thread has one megabyte of stack space. Therefore, you can create at most 2,048 threads. If you reduce the default stack size, you can create more threads. However, your application will have better performance if you create one thread per processor and build queues of requests for which the application maintains the context information. A thread would process all requests in a queue before processing requests in the next queue.
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
[My articles]
|
|
|
|
|
|
jt_snjy07 wrote: how many threads can possibly be made in a program please explian launguage wise
http://www.nvidia.com/object/fermi_architecture.html[^]
Thousands, many thousands.... probably not the architecture you meant.... but you didn't specify any limits.
_________________________
John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
Shhhhh.... I am not really here. I am a figment of your imagination.... I am still in my cave so this must be an illusion....
|
|
|
|
|
It depends on the thread library's implementation. For example if you were mad enough to create a user mode library then the number of threads would depend on how many thread contexts you could fit into memory in one process. If you're using kernel threads then it depends on how the OS is implemented and how many thread contexts it reserves space for.
Cheers,
Ash
|
|
|
|
|
Whenever I hear this question (it comes up a lot) I immediately suspect it's from someone who's application is using way too many.
Steve
|
|
|
|
|
C calling convention we all know defines a way how the parameters are pushed onto the stack.
My question is when and how does this C calling conventions matters to a user?
When the user will have to bother about the calling conventions in his project?
|
|
|
|
|
For instance when you write a dll that could be used in programs which are using another calling convention. Typically, using a C dll in a VB program.
|
|
|
|