Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AccessViolationException Error calling VFP DLL in C# VS2010
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
AccessViolationException Error calling VFP DLL in C# VS2010
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01610901
Message ID:
01610901
Vues:
26
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
Fil
Voir

Click here to load this message in the networking platform