Im trying to use an external DLL and extract data from the dll. my code is as follows:
myMethod should return a Zero "0". but when I run it I get an error message "vshost.exe has stopped working".
thanks so much for your help.
myMethod should return a Zero "0". but when I run it I get an error message "vshost.exe has stopped working".
Code:
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[DllImport("c:\\Program Files\\DHI\\Calibration\\muEpanet2.dll")]
public static extern long myMethod (ref string F1, ref long F2, ref long F3);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
long errorCode;
string fileLocation = "c:\\base_zk-M1.res";
long secondParameter = 13;
long thirdParameter = 0;
errorCode = myMethod (ref fileLocation, ref secondParameter, ref thirdParameter);
}
}
Comment