Re: Error when importing DLL



in asp you are calling your dll thru com, in asp.net you are trying to do
native C calls. you need to make a com interop wrapper, or read docs on
calling com interfaces.

for asp.net you will need to know if you com obj is STA (vb6) or not. if its
STA and your pages must specify aspcompat=true (at some performance cost).
it can not be used from a webservice (as there is no aspcompat support) also
you must call Marshal.ReleaseComObject or you will have a memory "leak".

-- bruce (sqlwork.com)

"vermin" <vermin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:37F495A9-6FBA-404F-8A4C-0CA388251744@xxxxxxxxxxxxxxxx
Good morning.

I have received a dll with an encrypting function I have to use in a
asp.net
page.

I can't import it correctly. In classic asp I use the method I want in
this
way:

<%
Set x = Server.CreateObject("BitamEncrypt.clsEncrypt")
If Not x Is Nothing Then
Response.Write x.Encrypt("hola")
End If
%>

This works correctly and the string is encrypted. When writing it asp.net
I'm having some problems. I am using dllImport:

[System.Runtime.InteropServices.DllImport("BitamEncrypt.dll",
EntryPoint="clsEncrypt.Encrypt")]
internal static extern string Encrypt(string a);

When invoking the Encrypt method I get an EntryPointNotFoundException. I
also get it if I declare the Entrypont parameter like this:
EntryPoint="Encrypt".

Any idea to solve this??

Thanks a lot!!




.



Relevant Pages

  • Accessing .NET DLL(s) from Classic ASP
    ... I have similar question that i saw yesterday (Calling .NET DLL from Classic ... We have production website running on Classic ASP (Windows Server 2003 E.Ed ... to their respective colleges (they have provided us web services), ...
    (microsoft.public.inetserver.asp.components)
  • Using CSocket calls in COM+ DLL blocking IIS 6.0
    ... I am calling a STA COM+ DLL method from within an ASP page in IIS ...
    (microsoft.public.vc.atl)
  • FAX sample application on W2003: office documents
    ... I've created an ActiveX dll with this code: ... the fax is put in the outgoing queue and ready to be sent. ... 1b- calling the dll to fax myfile=test.pdf from a sample .asp page: ...
    (microsoft.public.windowsxp.print_fax)
  • Unload com componant
    ... After copying it to the server and registering it I call it from an .asp page ... After calling it, I can no longer create the .dll with changes. ...
    (microsoft.public.inetserver.iis)
  • Re: The Lib debate
    ... >>Calling Functions in a DLL is a comletely different thing. ... For shared object libraries you have to call ... I have been told that zip comes with a Lib only. ...
    (alt.lang.asm)