Hola, hace unos dias hice una pregunta respecto a consumir una dll en delphi
que tenia el siguiente prototipo
procedure _EncryptDB(pS: ShortString;var
strResult:ShortString);Stdcall;External 'commonr.dll';
despues d unos post y unas averiguaciones lo resolvi de la siguiente
manera...
[DllImport("commonr.dll", CallingConvention=CallingConvention.StdCall)]
static extern void _EncryptDB(
[MarshalAs(UnmanagedType.LPArray)] byte[] strToEncrypt,
[MarshalAs(UnmanagedType.LPArray)] byte[] strResult );
unsafe public String EncryptWord(String toEncrypt)
{
byte[] toEnc = new byte[256];
byte[] toEnc1 = new byte[256];
toEnc = System.Text.Encoding.ASCII.GetBytes(toEncrypt);
toEnc1[0] = (byte)toEncrypt.Length;
for(int i=0; i<toEnc.Length ; i++)
{
toEnc1[i+1] = toEnc[i];
}
byte[] str = new byte[256];
_EncryptDB(toEnc1, str);
String Encrypted System.Text.Encoding.ASCII.GetString(str).Substring(1,(int)str[0]);
return Encrypted;
}
Asi funciona a la perfeccion , pero con el pequenio detalle q el resto de mi
aplicacion web no funciona despues d ejecutar esta dll, hay alguna forma de
hacer como un Unload, sera q esta interferiendo con la memoria del equipo,
sera mi equipo?? si alguien tiene algun problema parecido porfa
contesteme...Gracias
pdta: La dll es consumida desde la aplicacion delphi sin ningun problema.
Salu2
OScar GALvis
Leer las respuestas