|
Chandrasekharanp wrote: i have 4 check boxes and checking each check box will lead to a creation of a file and logging of data. now i need o flush out the logged data when i uncheck the check box.
That's more than one thing to be done. What exactly do you need help on? What have you tried?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi,
I have created a dll in VC++ and an EXE that uses this dll. One of the function called Open(..) present in dll connect to a server. My exe calls this Open(..) function.
when I run my exe for the first time it connects to the server. All the other tries fails. But if I run the exe in debug mode it works. what would be the problem
Can any one help?
Thank you.
Regards,
lg.
lgatcodeproject
|
|
|
|
|
That has probably nothing to do with the fact that it is a dll. Did you try to paste the code from Open in the exe directly to see what's happening ? Does it also fail ?
|
|
|
|
|
Hello everyone,
Such code segment is used to check whether function call or exception-handling mechanism runs out of memory first (written by Bjarne),
void perverted()
{
try{
throw exception();
}
catch (exception& e)
{
perverted();
cout << e.what() << endl;
}
}
1.
My question is when the exception is thrown, and goes to exception handler in catch block, it will do operations in the following sequences,
(1) execute the exception handler code (since there will be recursive function call -- stack will ever increasing);
(2) unwind stack.
Runs out of memory because function call will make stack ever-increasing, right?
If it does (2) before (1), I think stack will always be unwinded before exception handling is called -- then stack will never grow, so there will be no out-of-memory caused by an ever increasing stack.
Is that correct?
2.
I am confused about why exception handling mechanism will run out of memory because in exception handle implementation, we just insert exception handler registration block of the function onto the beginning of the new function call stack each time there is a function call, so the memory should be the memory consumed by function call stuff, I do not think exception handling mechanism itself will consume additional memory. How do you think of it and how do you think of the what are the memory consumed by exception handling mechanism?
thanks in advance,
George
|
|
|
|
|
George_George wrote: If it does (2) before (1)
The above cannot happen.
George_George wrote: I am confused about why exception handling mechanism will run out of memory because in exception handle implementation, we just insert exception handler registration block of the function onto the beginning of the new function call stack each time there is a function call, so the memory should be the memory consumed by function call stuff, I do not think exception handling mechanism itself will consume additional memory. How do you think of it and how do you think of the what are the memory consumed by exception handling mechanism?
I think we can consider it in a broad sense, i.e. if you remove the throw statement, then no stack overflow happens.
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.
[my articles]
|
|
|
|
|
CPallini wrote: I think we can consider it in a broad sense, i.e. if you remove the throw statement, then no stack overflow happens.
Because the recursion breaks.
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: Because the recursion breaks.
OMG, and how was you able to find out 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.
[my articles]
|
|
|
|
|
Maxwell Chen
|
|
|
|
|
Thanks CPallini,
1.
CPallini wrote: The above cannot happen.
I think you agree with my points that the sequence analysis execute (1) then execute (2).
Which is,
--------------------
My question is when the exception is thrown, and goes to exception handler in catch block, it will do operations in the following sequences,
(1) execute the exception handler code (since there will be recursive function call -- stack will ever increasing);
(2) unwind stack.
--------------------
Runs out of memory because function call will make stack ever-increasing, right?
2.
CPallini wrote: I think we can consider it in a broad sense, i.e. if you remove the throw statement, then no stack overflow happens.
Does your above point related to my 2nd question? What additional memory is consumed by exception handling mechanism?
regards,
George
|
|
|
|
|
George_George wrote: right?
Yes.
George_George wrote: Does your above point related to my 2nd question?
Yes.
George_George wrote: What additional memory is consumed by exception handling mechanism?
Of course it is recursive function calls that make the stack ovewrflowing (and of course you haven't recursive function calls if you drop the throw statement, perhaps Bjarne was just curious to see whether stack overflow happens inside the catch block or not...).
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.
[my articles]
|
|
|
|
|
Thanks CPallini,
Let me make my question more clear. In the sample code I posted in my original question, Bjarne is used to show whether function call or exception handling mechanism will run out of memory at first.
It is clear as we have discussed function call will continue to consume stack -- to make memory out of run.
Now I am unclear about what is the memory consumed by exception handling mechanism as Bjarne mentioned, since all I can see the memory consumed is caused by function call (recursive), but not by exception handling mechanism itself.
Any ideas about memory consumed by exception handling mechanism itself?
regards,
George
|
|
|
|
|
dear all
what is difference between struct and union? thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
The members of a union share the same address.
Maxwell Chen
|
|
|
|
|
I found this nice site[^], where you can find answers to such questions.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: I found this nice site[^]
Thank you very mutch man, nice site, never seen it before, how was you able to find out?
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.
[my articles]
|
|
|
|
|
CPallini wrote: how was you able to find out
Well, he just googled for it... Errr... wait
|
|
|
|
|
CPallini wrote: how was you able to find out?
Got it in one of those forwarded e-mails.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hello all
I am developing an application for video encoding.
For that i am using x.264 library to Encode video frames.
It works fine if i compile my project as c code but it gives linking error when i compile it as c++.
And my need is c++, so is there anybody who can help me?
Thanks in advance.
Regards.
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
manish.patel wrote: x.264 library
Again?!
Maxwell Chen
|
|
|
|
|
I am asking first Time on this forum and why are you saying again?
Manish Patel.
B.E. - Information Technology.
|
|
|
|
|
manish.patel wrote: I am asking first Time on this forum and why are you saying again?
Another people just asked the same question one hour ago (here[^]). So x.264 library is hot today!
Maxwell Chen
|
|
|
|
|
I am am drawing gradient color on CTreeCtrl background and i want to make CTreeCtrl TV_ITEM labels ( text labels 0 trasparent ...
I am getting Image transparent
but not the text labels next to the image ... thats what is the problem
please let me know how to make it
thanks in advance
|
|
|
|
|
This same question was answered yesterday. please read back to get your answer.
Iain.
|
|
|
|
|
Thanks Iain,
That solution will work only when there is background image is need to be painted
I shud not have any background image to me painted
coz i am painting Gradient color in background
now how to make the lables trasparent?
Though
in that solution who is calling CTreeCtrlX::SetBkImage(UINT nIDResource)fuction is not there...
there is no message who will call the function
please help me if u can
first of all i shud not use image coz .. gradient color need to me painted .. gradient i have done but the labels......
whats the solution
or can you please tell me how i can use the code mentioned in the Article
|
|
|
|
|
Have a look at the CXTreeCtrl control, and see the parts where they paint a bitmap. Just replace those with drawing a gradient.
Just because the answer hasn't been given to you 100%, doesn't mean you can't adapt their work.
Iain.
|
|
|
|