473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Unable to find an entry point named in DLL

Hi Guys,

I am trying to use a C++ dll in VB.NET code.

I have imported the dll in the following manner:

<code>

Imports System.Runtime.InteropServices

Module modDllImport
<DllImport("hsec.dll")> _
Public Function sha1_hash(ByRef co As String, ByRef ci As String) As
Integer
End Function

<DllImport("aes.dll")> _
Public Function aes_enc(ByRef co As String, ByRef ci As String) As Integer
End Function
End Module

</code>

However when I call the exported method, I get the following error:

Unable to find an entry point named sha1_hash in DLL hsec.dll.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.EntryPointNotFoundException: Unable to find an
entry point named sha1_hash in DLL hsec.dll.
I am not sure where I am going wrong. The dlls are in my system32 folder as
well. I hope that .NET works with normal C/C++ dlls as well along with COM
dlls.

Any kind of help would be really appreciated.

Thanks,

Regards,
-Prashant
Nov 20 '05 #1
6 17908
another victim of name mangling i suppose ;-)

c++ compiler will mangle names, when compiling the c++ the dll generate a
map file and look at the real names (in case you have the dll's source
surround the declarations with extern "C" blocks to stop the mangling)

you can also use the dumpbin tool to look at the actual exported function
names in the dll

HTH
Rahul
r_*****@nospam.yahoo.com


"Prashant Bhuptani" <pb*******@itstrategists.com> wrote in message
news:ef**************@TK2MSFTNGP09.phx.gbl...
Hi Guys,

I am trying to use a C++ dll in VB.NET code.

I have imported the dll in the following manner:

<code>

Imports System.Runtime.InteropServices

Module modDllImport
<DllImport("hsec.dll")> _
Public Function sha1_hash(ByRef co As String, ByRef ci As String) As
Integer
End Function

<DllImport("aes.dll")> _
Public Function aes_enc(ByRef co As String, ByRef ci As String) As Integer End Function
End Module

</code>

However when I call the exported method, I get the following error:

Unable to find an entry point named sha1_hash in DLL hsec.dll.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.EntryPointNotFoundException: Unable to find an
entry point named sha1_hash in DLL hsec.dll.
I am not sure where I am going wrong. The dlls are in my system32 folder as well. I hope that .NET works with normal C/C++ dlls as well along with COM
dlls.

Any kind of help would be really appreciated.

Thanks,

Regards,
-Prashant

Nov 20 '05 #2
* "Prashant Bhuptani" <pb*******@itstrategists.com> scripsit:
I am trying to use a C++ dll in VB.NET code.

I have imported the dll in the following manner:

<code>

Imports System.Runtime.InteropServices

Module modDllImport
<DllImport("hsec.dll")> _
Public Function sha1_hash(ByRef co As String, ByRef ci As String) As
Integer
End Function

<DllImport("aes.dll")> _
Public Function aes_enc(ByRef co As String, ByRef ci As String) As Integer
End Function
End Module

</code>

However when I call the exported method, I get the following error:

Unable to find an entry point named sha1_hash in DLL hsec.dll.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.EntryPointNotFoundException: Unable to find an
entry point named sha1_hash in DLL hsec.dll.


Can you post the "heads" of the C functions and the exports of the C
DLL?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3
On 2003-11-06, Rahul Kapoor <sp**@nospam.com> wrote:
another victim of name mangling i suppose ;-)

c++ compiler will mangle names, when compiling the c++ the dll generate a
map file and look at the real names (in case you have the dll's source
surround the declarations with extern "C" blocks to stop the mangling)


Not if your using __stdcall. The best way to do it is to create a .def
file.

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #4
Hi Herfried,

I have a test code in VC++ which calls the exported methods of these dlls.
These methods are declared in the header file as follows:

__declspec(dllexport) int sha1_hash(const unsigned char ci[],unsigned char
co[]);
__declspec(dllexport) int aes_enc(const unsigned char ci[],char co[]);

However, I don't have the code which is used to create the dll.
So as of now I am not sure how the .def file is created, but if that helps
in solving this problem, I can definitely find out.

Thanks,

Regards,
-Prashant


"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bo*************@ID-208219.news.uni-berlin.de...
* "Prashant Bhuptani" <pb*******@itstrategists.com> scripsit:
I am trying to use a C++ dll in VB.NET code.

I have imported the dll in the following manner:

<code>

Imports System.Runtime.InteropServices

Module modDllImport
<DllImport("hsec.dll")> _
Public Function sha1_hash(ByRef co As String, ByRef ci As String) As
Integer
End Function

<DllImport("aes.dll")> _
Public Function aes_enc(ByRef co As String, ByRef ci As String) As Integer End Function
End Module

</code>

However when I call the exported method, I get the following error:

Unable to find an entry point named sha1_hash in DLL hsec.dll.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.EntryPointNotFoundException: Unable to find an
entry point named sha1_hash in DLL hsec.dll.


Can you post the "heads" of the C functions and the exports of the C
DLL?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #5
In article <u9*************@tk2msftngp13.phx.gbl>, Prashant Bhuptani wrote:
Hi Herfried,

I have a test code in VC++ which calls the exported methods of these dlls.
These methods are declared in the header file as follows:

__declspec(dllexport) int sha1_hash(const unsigned char ci[],unsigned char
co[]);
__declspec(dllexport) int aes_enc(const unsigned char ci[],char co[]);

However, I don't have the code which is used to create the dll.
So as of now I am not sure how the .def file is created, but if that helps
in solving this problem, I can definitely find out.

Thanks,

Regards,
-Prashant


do a dumpbin /exports on the dll to see the exported names of the
functions. More then likely, they are not sha1_enc and aes_enc. There
is generally type information appended to the names (I don't remember
the exact characters any more). The point is, if there is no .DEF file
for the functions, the names actually get changed by the compiler. To
use them from VB.NET, you will need to specify that name...

Delcare Function sha1_hash Lib "...." Alias "exported name from dumpbin"

(....) As ....

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #6
Thanks a lot Tom and everyone else for your help.

So after doing a dumpin /exports on the dll I used the exported function
names and declared it in my VB code.
And hence it works now. So there was definitely no .DEF file used for the
functions.

Thanks again.

regards,
-Prashant

"Tom Shelton" <to*@mtogden.com> wrote in message
news:u$**************@TK2MSFTNGP10.phx.gbl...
In article <u9*************@tk2msftngp13.phx.gbl>, Prashant Bhuptani

wrote:
Hi Herfried,

I have a test code in VC++ which calls the exported methods of these dlls. These methods are declared in the header file as follows:

__declspec(dllexport) int sha1_hash(const unsigned char ci[],unsigned char co[]);
__declspec(dllexport) int aes_enc(const unsigned char ci[],char co[]);

However, I don't have the code which is used to create the dll.
So as of now I am not sure how the .def file is created, but if that helps in solving this problem, I can definitely find out.

Thanks,

Regards,
-Prashant


do a dumpbin /exports on the dll to see the exported names of the
functions. More then likely, they are not sha1_enc and aes_enc. There
is generally type information appended to the names (I don't remember
the exact characters any more). The point is, if there is no .DEF file
for the functions, the names actually get changed by the compiler. To
use them from VB.NET, you will need to specify that name...

Delcare Function sha1_hash Lib "...." Alias "exported name from dumpbin"

(....) As ....

--
Tom Shelton
MVP [Visual Basic]

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Randy Crockett | last post by:
I have created a very simple DLL in VC++ 6.0, then created a very simple App in VC++ 6.0 to use the DLL and this works fine When I try to use the same DLL in C#, with DLLImport, the app finds the...
6
by: aneesh | last post by:
Hi all, I would like to know whether we can specify another function instead of main as entry point. Thanks Aneesh
0
by: Sam Fields | last post by:
I have found very little regarding the error "Unable to find an entry point named EnumerateSecurityPackagesW in DLL security.dll. ". I have an ASP.NET Web Service being accessed via SSL. I found...
1
by: TRI_CODER | last post by:
I am trying to solve the following exception. The exception occurs when my ASP.NET code behind code attemtps to access a remore site using SSL. Please note that all certificates are valid and the...
5
by: Pratibha | last post by:
hi, i made a dll named rtbdts.dll and call it from vb.net through dllimport <DllImport("C:\misc\rtbdll\rtbdts.dll")> Public Shared Function Init() As String End Function But it returns the...
3
by: Saman | last post by:
I have a third party dll and I am sure that it is not an activeX or dotnet assembly . I have check it up with Dependency Walker software and found the list of it's exported function in C++ syntax...
1
by: raam_kimi | last post by:
Hi All I got some problem in importing advapi32.dll when i call the LogonUser method it throws an error like this 'Unable to find an entry point named LogonUser in DLL advapi32.dll.' ...
4
by: =?Utf-8?B?SnVhbiBEZW50?= | last post by:
Hi, I am getting the following in a VC++ EXE (using VS2005) that links several C++ DLLs and uses MFC and ATL, when I try to start it under the debugger: ------- 'Exactus.UX.Studio.v1.exe':...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.