Hi,
I have an application of wxwidgets. I have wxGrid in my application and I am deleting and inserting some rows at runtime.
I call grid->DeleteRows(pos, numRows). When the function returns from DoModifyLines(bool (wxGridTableBase::*funcModify)(size_t, size_t),
int pos, int num, bool WXUNUSED(updateLabels) ), I am getting crash. I have attached the snapshot of the error message.
Same thing (ie. grid->DeleteRows(pos, numRows) if I do from grid sample, I works fine. What can go wrong here ?
wxGrid : calling DeleteRows is crashing
Re: wxGrid : calling DeleteRows is crashing
I don't see a snapshot.
Please make sure that the grid is already created when you make the call. Also check that the "pos" and "numRows" paramaters are valid. E.g. that pos+numRows does not go beyond the last row of the grid.
Please make sure that the grid is already created when you make the call. Also check that the "pos" and "numRows" paramaters are valid. E.g. that pos+numRows does not go beyond the last row of the grid.
Use the source, Luke!
Re: wxGrid : calling DeleteRows is crashing
Hi,
It is best not to attach a screenshot of the error, but put it in the text (copy'n'paste).
Now, what do you mean by crash? Does the program asserts and youget a nice assertion report from the wxWidgets? Or you get a crash from Windows where you are asked if you want to Debug the application or stop it?
Thank you.
It is best not to attach a screenshot of the error, but put it in the text (copy'n'paste).
Now, what do you mean by crash? Does the program asserts and youget a nice assertion report from the wxWidgets? Or you get a crash from Windows where you are asked if you want to Debug the application or stop it?
Thank you.
Re: wxGrid : calling DeleteRows is crashing
Hi,
Ok. I forgot to attach snapshot. I will make it more clear. I have derived a class from wxGrid. I am calling the function DeleteRows from one of the functions of my derived class.
void myGrid::updateGrid(int pos, int numRows)
{
DeleteRows(pos, numRows);
}
When the call returns from the function DoModifyLines(&wxGridTableBase::DeleteRows ,pos, numRows, updateLabels);
I will get following error message.
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
I have made sure that pos+numRows < totalNoOfRows .
My application is written using c++. So i do not see anywhere the mismatch between calling conventions. What could be the possible cause of such an error message ?
Ok. I forgot to attach snapshot. I will make it more clear. I have derived a class from wxGrid. I am calling the function DeleteRows from one of the functions of my derived class.
void myGrid::updateGrid(int pos, int numRows)
{
DeleteRows(pos, numRows);
}
When the call returns from the function DoModifyLines(&wxGridTableBase::DeleteRows ,pos, numRows, updateLabels);
I will get following error message.
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
I have made sure that pos+numRows < totalNoOfRows .
My application is written using c++. So i do not see anywhere the mismatch between calling conventions. What could be the possible cause of such an error message ?
Re: wxGrid : calling DeleteRows is crashing
Hi,
Are you using DLL anywhere?
Do you have anything that have "C" interface and not declared as
exterm "C"
?
Thank you.
Are you using DLL anywhere?
Do you have anything that have "C" interface and not declared as
exterm "C"
?
Thank you.
Re: wxGrid : calling DeleteRows is crashing
Hi,
Yes. My application is a DLL. I have extern "C" functions In my application.
Ex: extern "C" __declspec(dllexport)
void myFunc() { }
But DeleteRows() I am calling from a function which is normal c++ member function (it is not extern C function).
Yes. My application is a DLL. I have extern "C" functions In my application.
Ex: extern "C" __declspec(dllexport)
void myFunc() { }
But DeleteRows() I am calling from a function which is normal c++ member function (it is not extern C function).
Re: wxGrid : calling DeleteRows is crashing
This is not a common mistake. AFAIR i only encountered it once or twice and in both cases it was caused by incompatible libraries. Double-check the compiler and linker settings for all libraries in your project. Make sure they all include the headers from the same locations.Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
The documentation for wxGrid::DeleteRows() says:
Are you using a custom wxGridTableBase? And if yes, did you override wxGridTableBase::DeleteRows()?If you are using a derived grid table class you will need to override wxGridTableBase::DeleteRows().
Use the source, Luke!