|
Hi,
I am having this run time error message.
Run-Time Check Failure #2 - Stack around the variable 'buffer' was corrupted.
It makes sense for me, but
Anybody could give me some detail ideas about this error message?
Thanks!
Yonggoo
|
|
|
|
|
Yonggoo wrote: It makes sense for me, but
Anybody could give me some detail ideas about this error message?
If it makes sense for you, what further explanation do you require?
See here for possibilities.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
See where?
I am not the person that asked this question, but I have done many searches. I find a few questions in other sites and many in this site about this specific error message, but there is nothing that provides a diagnostic solution. In other words, nowhere is there something explaining how to diagnose this problem. It is easy to say to search for answers and I have provided that answer to to others many times before in other forums. Yet in this situation, the answer is not easy to obtain by simply searching. So did you look to see if your answer is any help? I think not. I think you were stuck in the mode of saying to search, but you don't really know the answer and did not look to see if searching has any value for this problem.
|
|
|
|
|
I see "delete this" in a lot of code. For example, in an SDI application, when user clicks on a button on the view, the application needs to swap to a different view. so it will delete the current view and create a new view, "delete this" will be performed somewhere near to the end of the message handler of the button, which is a member function. What is the life time of all member variables at this point? Are they all destructed? Does this mean if I'm trying to acces those variables right after the "delete this", the application might crash?
Thanks!
|
|
|
|
|
You'll also see delete this in the context of modeless dialog boxes.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
You can call delete this from a member function: After doing so you can't access any member variables or call any non-static member functions that do as the memory for the class instance has been returned to the heap from whence it came and the class invariants have no doubt been invalidated by the destructor.
Steve
|
|
|
|
|
Hi All,
I am creating a list box with multiple selection at a time.
I would appreciate if someone let me know how to add items in LIST BOX using MFC.
For example: I need to add USA, CANADA, MEXICO, ENGLAND, INDIA, CHINA in my list.
How to add these itmes?
Do I need to write code or just can do it other way?
Thanks in advance
MFC
|
|
|
|
|
Preeti9 wrote: I would appreciate if someone let me know how to add items in LIST BOX using MFC.
Use CListBox::AddString() or CListBox::InsertString() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanks for your help.
Should it be like this:
[\code]
CListBox::AddString()
{
AddString("USA");
AddString("CANADA");
.....
..
}
C++Prog
|
|
|
|
|
No. You will need a CListBox control variable (use ClassWizard for this), then call AddString() in the context of that variable.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
O okay, Thanks...I got it.
Thanks once again
MFC
|
|
|
|
|
if the content is static ( will be filled once with constant values ) then, you can add them directly in the resource editor ( no code needed for that ).
if the contenct is dynamic, you can use CListBox::AddString or CListBox::InsertString ( you need to code this ).
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks for your reply.
Yes, the content is Static. Can you please give me some idea how to add this in resource editor.
Thanks Once Again
MFC
|
|
|
|
|
Preeti9 wrote: Yes, the content is Static. Can you please give me some idea how to add this in resource editor.
While it might be considered a neat idea, this solution has many drawbacks. In fact, it is only useful if the items in the control are language independent, and are insensitive to sorting.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hmmm, Thanks I got it.
MFC
|
|
|
|
|
Like this
CListBox m_List;
m_List.AddString("123");
m_List.InsertString(1,"2323");
|
|
|
|
|
What is the best way to do it (VC++6.0 + MFC +Dialogapp) ?
~RaGE();
|
|
|
|
|
I use _access() , which is really just a wrapper around GetFileAttributes() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
You can use CFile::GetStats() to retirve the status of a file, if it exist.
|
|
|
|
|
Ajax95 wrote: You can use CFile::GetStats()...
From whence does this method exist? Perhaps you meant CFile::GetStatus() instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
i've been using ::PathFileExists() also
|
|
|
|
|
I used directshow Imediaseeking::getduration and windows media format sdk to extract mp3 song duration, but I got two different values. Result from IMediaSeeking is about 5 times longer than that from sdk. I am not familiar with structure of mp3. Thanks for any informations about this problem.
|
|
|
|
|
I'm not at all familiar with the programs/components you are referring to, but I'd be guessing that the mp3 is VBR (variable bit rate). I know in the past some programs have read times wrong because they have been code for a fixed rate.
When I die I'd like to go peacefully in my sleep like my father, not screaming in terror like his passengers!!!
|
|
|
|
|
Thank you. You are right. It is VBR. Do you have any ideas about how to fix this problem to extract the right duration? My situation is I am using directshow IMediaSeeking::setpositions to set the stop time(absolute), directshow IMediaSeeking::getduration extract the wrong duration (5 times longer). Is there any way to extract right duration from VBR mp3 using directshow? Thanks again.
|
|
|
|
|
Hi;
1|2|3
4|5|6
7|8|9
That is a tic tac, in c++.
I want to replace 5 by X and 3 by 0, but I have problem SET().
Can I do the following way move?
set X (int);
if( board [4]== 5)
return X;
-- modified at 9:34 Thursday 30th March, 2006
|
|
|
|