I have a 3th party dll writen in C. I have no problem calling most functions in the dll from the managed code. But there is a function that take a function pointer for setting a callback function that I am having problems with.
I have the following code:
The problem is I can debug into the calling of MFun but when I return I get the following errors
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.
Read dozens of examples given on website how to do an single array with
the System::Array etc. But I can't get the hang of it how to use it properly.
I keep getting error messages when I hit the build button.
For example I want a simple 2 dimension array of the integer type.
in the old code it was:
board = 5;
if i try to use the managed version:
array<int^,2>^ m_Board = gcnew array<int^,2>(16,16);
for (int row = 0; row < 16;row++)
for (int col = 0; col < 16;col++)
m_Board[row][col] = 0;
I get error message on my screen.
Also I can't find anything about freeing the memory in the articles.
Is it neccessary if you use it in a class.
How do I free it if it's necessary?
Can I change the size of the area dynamically?
"Knowledge shouldn't be preserved by one, but shared with others."
I'm having a problem using the DataGrid/DataGridView within a MFC dialog (using the CWinFormsControl< > template).
I create a DataSet from a Xml file and then set it to the DataSource. I also set the DataMember to the appropriate table name, but nothing is displayed in the grid view. I tried other various approaches, but nothing seems to work.
I have no problem setting this up in WinForms - it won't work in MFC. I know the data's there because I can actually step right into it from the DataGrid object (debugger) - it just won't display - the ColumnCount is still 0.
What's the problem? Has anyone else experienced this?