S
Safiiru no Baka
Hi thanks for reading this. I'll keep it simple.
In a project I've a MFC DLL:
---------------------------------------------------------------------------------------------
extern "C"
{
__declspec(dllexport) int DoSomethingInC()
{
return 5;
}
}
---------------------------------------------------------------------------------------------
In the same project I have a C# Windows App with the following:
---------------------------------------------------------------------------------------------
[DllImport(@"C:\Documents and Settings\My Documents\Visual Studio
Projects\C_DLL\C_DLL\Release\C_DLL.dll", EntryPoint="DoSomethingInC")]
public static extern int DoSomethingInC();
---------------------------------------------------------------------------------------------
and
---------------------------------------------------------------------------------------------
private void button1_Click(object sender, System.EventArgs e)
{
double ABC = DoSomethingInC();
MessageBox.Show("Result: "+ABC,"");
}
---------------------------------------------------------------------------------------------
Questions:
1) Any way I can load the DLL without typing the whole address? I cant
seem to get it to load otherwise
2) The messagebox is returning NaN for the ABC variable. I dont know
what is wrong.
thanks again.
In a project I've a MFC DLL:
---------------------------------------------------------------------------------------------
extern "C"
{
__declspec(dllexport) int DoSomethingInC()
{
return 5;
}
}
---------------------------------------------------------------------------------------------
In the same project I have a C# Windows App with the following:
---------------------------------------------------------------------------------------------
[DllImport(@"C:\Documents and Settings\My Documents\Visual Studio
Projects\C_DLL\C_DLL\Release\C_DLL.dll", EntryPoint="DoSomethingInC")]
public static extern int DoSomethingInC();
---------------------------------------------------------------------------------------------
and
---------------------------------------------------------------------------------------------
private void button1_Click(object sender, System.EventArgs e)
{
double ABC = DoSomethingInC();
MessageBox.Show("Result: "+ABC,"");
}
---------------------------------------------------------------------------------------------
Questions:
1) Any way I can load the DLL without typing the whole address? I cant
seem to get it to load otherwise
2) The messagebox is returning NaN for the ABC variable. I dont know
what is wrong.
thanks again.