Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
AccessViolationException Error calling VFP DLL in C# VS2010
Versions des environnements
Network:
Windows 2008 Server
Friends,
How to I resolve the AccessViolationException Error calling VFP DLL in C# VS2010? The test VFP DLL and test C# app works fine in VS2005, but not in VS2010
VFP8
DEFINE CLASS Functions AS Custom OLEPUBLIC
FUNCTION Test(lnInt as Integer) as Boolean
RETURN .T.
ENDFUNC
ENDDEFINE
C# VS2010
private void button1_Click(object sender, EventArgs e)
{
bool result;
testdll.Functions test = new testdll.Functions();
result = test.Test(99);
if (result == true) MessageBox.Show("Returned True"); else MessageBox.Show("Returned False");
}
Error on statement : result = test.Test(99); AccessViolationException was unhandled. Attempted to read or write protected memory.
Note : Set Platform target to x86. Target framework was set to 2.0 by migration wizart. Checked Allow unsafe code.
Thanks!!!!!!
Ellis
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement