473,386 Members | 1,773 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.

How Do I Create an Entry Point for a DLL?

TC
I'm using VB.NET 2005. I need to create a DLL containing a function
F(). A VB.NET application will reference the DLL by using a Declare
statement.

Declare Function F Lib "Foo.dll" (ByVal Woo As String) As Double

When I write the DLL and test it, however, I get a runtime error.

Unable to find an entry point named 'F' in DLL 'Foo.dll'.

Judging from the error, it sounds like I need to create an "entry
point" in my DLL. Can anyone tell me how to do that?

Please note that I have no control over the code which calls my
function. That code uses a Declare statement.
-TC

Jul 29 '06 #1
5 9403

TC wrote:
I'm using VB.NET 2005. I need to create a DLL containing a function
F(). A VB.NET application will reference the DLL by using a Declare
statement.

Declare Function F Lib "Foo.dll" (ByVal Woo As String) As Double

When I write the DLL and test it, however, I get a runtime error.

Unable to find an entry point named 'F' in DLL 'Foo.dll'.

Judging from the error, it sounds like I need to create an "entry
point" in my DLL. Can anyone tell me how to do that?
You can't. Declare statements are used to interact with native dll's
not managed dll's, in other words, managed applications do not
reference managed dll's via a declare statement. You will need to
write your dll in a language that supports this - like C++, PowerBasic,
etc.

Of course, there may be hacks to do this, just as there were for
VB.CLASSIC. I haven't looked, nor would I ever suggest anyone did
this. It is just not the way the tool your using works.

--
Tom Shelton

Jul 29 '06 #2

Hacks , for Vb classic ???

http://www.windowsdevcenter.com/pub/...reate_dll.html

i do not see somuch hack about it ,, i see it more as a undocumented feature
:-)

Haven`t tried it but it might also work in VB.Net
regards

Michel Posseth

"Tom Shelton" <to*@mtogden.comschreef in bericht
news:11*********************@h48g2000cwc.googlegro ups.com...
>
TC wrote:
>I'm using VB.NET 2005. I need to create a DLL containing a function
F(). A VB.NET application will reference the DLL by using a Declare
statement.

Declare Function F Lib "Foo.dll" (ByVal Woo As String) As Double

When I write the DLL and test it, however, I get a runtime error.

Unable to find an entry point named 'F' in DLL 'Foo.dll'.

Judging from the error, it sounds like I need to create an "entry
point" in my DLL. Can anyone tell me how to do that?

You can't. Declare statements are used to interact with native dll's
not managed dll's, in other words, managed applications do not
reference managed dll's via a declare statement. You will need to
write your dll in a language that supports this - like C++, PowerBasic,
etc.

Of course, there may be hacks to do this, just as there were for
VB.CLASSIC. I haven't looked, nor would I ever suggest anyone did
this. It is just not the way the tool your using works.

--
Tom Shelton

Jul 30 '06 #3
TC
Tom,

Thank you for the clear answer. I wrote the code in C++ and it works
well.

How can I know which languages support native DLLs and which support
managed DLLs? I used the Borland C++ compiler to generate my DLLs.
Could I have used Visual C++ .NET instead?

-TC
Tom Shelton wrote:
TC wrote:
I'm using VB.NET 2005. I need to create a DLL containing a function
F(). A VB.NET application will reference the DLL by using a Declare
statement.

Declare Function F Lib "Foo.dll" (ByVal Woo As String) As Double

When I write the DLL and test it, however, I get a runtime error.

Unable to find an entry point named 'F' in DLL 'Foo.dll'.

Judging from the error, it sounds like I need to create an "entry
point" in my DLL. Can anyone tell me how to do that?

You can't. Declare statements are used to interact with native dll's
not managed dll's, in other words, managed applications do not
reference managed dll's via a declare statement. You will need to
write your dll in a language that supports this - like C++, PowerBasic,
etc.

Of course, there may be hacks to do this, just as there were for
VB.CLASSIC. I haven't looked, nor would I ever suggest anyone did
this. It is just not the way the tool your using works.

--
Tom Shelton
Jul 30 '06 #4
"TC" <go*********@yahoo.comschrieb:
How can I know which languages support native DLLs and which support
managed DLLs? I used the Borland C++ compiler to generate my DLLs.
Could I have used Visual C++ .NET instead?
Yes, you could have used Visual C++ .NET to do that.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Jul 30 '06 #5
Have just tried it and No i can`t get it to run ,, so it doesn`t work ,,,,
or i am missing something
"Michel Posseth [MCP]" <MS**@posseth.comschreef in bericht
news:eg**************@TK2MSFTNGP06.phx.gbl...
>
Hacks , for Vb classic ???

http://www.windowsdevcenter.com/pub/...reate_dll.html

i do not see somuch hack about it ,, i see it more as a undocumented
feature :-)

Haven`t tried it but it might also work in VB.Net
regards

Michel Posseth

"Tom Shelton" <to*@mtogden.comschreef in bericht
news:11*********************@h48g2000cwc.googlegro ups.com...
>>
TC wrote:
>>I'm using VB.NET 2005. I need to create a DLL containing a function
F(). A VB.NET application will reference the DLL by using a Declare
statement.

Declare Function F Lib "Foo.dll" (ByVal Woo As String) As Double

When I write the DLL and test it, however, I get a runtime error.

Unable to find an entry point named 'F' in DLL 'Foo.dll'.

Judging from the error, it sounds like I need to create an "entry
point" in my DLL. Can anyone tell me how to do that?

You can't. Declare statements are used to interact with native dll's
not managed dll's, in other words, managed applications do not
reference managed dll's via a declare statement. You will need to
write your dll in a language that supports this - like C++, PowerBasic,
etc.

Of course, there may be hacks to do this, just as there were for
VB.CLASSIC. I haven't looked, nor would I ever suggest anyone did
this. It is just not the way the tool your using works.

--
Tom Shelton


Jul 31 '06 #6

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

Similar topics

4
by: intl04 | last post by:
How do I create a data input form in Access that is external to the Access database to which it's connected (if that's possible, which I believe it is)? For example, if someone clicks on an Access...
6
by: SamIAm | last post by:
Hi am creating a email application that needs to mail out a very large amount of emails. I have created a multithreaded c# application that using message queuing. I have created a threadpool of 5...
3
by: Dennis Vansickle | last post by:
Hi all. I'm working with the Tao OpenGL libraries for C# but ran into a problem getting a function to work. What I've done is: // Set current context Wgl.wglMakeCurrent(hDC, hRC);
2
by: filbennett | last post by:
Hi Everyone, I'm generally unfamiliar with Access form design, but have programmed Cold Fusion applications for a couple of years. I'd like to build a data entry form in Access that allows the...
2
by: bboule | last post by:
Hi I have developped a dll that I want to use in another program ! here is my code : using System; using System.Collections.Generic; using System.Text; namespace NameSpace
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
10
by: Lung.S.wu | last post by:
Hi all, It is a history question. Recently, I read the book "C A reference manual, third edition". In this book, it list all C language keyword, and one is "entry". I know it is omitted from...
18
by: Angus | last post by:
Hello We have a lot of C++ code. And we need to now create a library which can be used from C and C++. Given that we have a lot of C++ code using classes how can we 'hide' the fact that it is...
5
by: Christiano Donke | last post by:
Plz.. I intend to share a class library though network. This library is gonna be called by a VB6 project. I've found out that a late file-based binding on vb6 is the easiest way to bind it......
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.