471,108 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,108 software developers and data experts.

Error when importing DLL

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("BitamEnc rypt.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!!
Jun 9 '06 #1
1 1113
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" <ve****@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
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("BitamEnc rypt.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!!

Jun 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by M.N.A.Smadi | last post: by
3 posts views Thread by Praetorian Prefect | last post: by
9 posts views Thread by advance scout | last post: by
reply views Thread by Alun Jones | last post: by
3 posts views Thread by nimajneb via AccessMonster.com | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.