|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How Do I Create an Entry Point for a DLL?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 TC wrote:
> I'm using VB.NET 2005. I need to create a DLL containing a function You can't. Declare statements are used to interact with native dll's> 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? > 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 Hacks , for Vb classic ???
http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_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.Netregards Michel Posseth Show quoteHide quote "Tom Shelton" <t**@mtogden.com> schreef in bericht news:1154161265.375548.86670@h48g2000cwc.googlegroups.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 > Have just tried it and No i can`t get it to run ,, so it doesn`t work ,,,,
or i am missing something Show quoteHide quote "Michel Posseth [MCP]" <M***@posseth.com> schreef in bericht news:egJNKG9sGHA.4140@TK2MSFTNGP06.phx.gbl... > > Hacks , for Vb classic ??? > > http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_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" <t**@mtogden.com> schreef in bericht > news:1154161265.375548.86670@h48g2000cwc.googlegroups.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 >> > > 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: Show quoteHide quote > 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 "TC" <golemdan***@yahoo.com> schrieb: Yes, you could have used Visual C++ .NET to do that.> 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? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Equivalent of DataGridTableStyle for DataGridView?
Date and Time Calculation. GDI+ Graphics Dump VB Module functions not available in 2005 Fetching data from a datagrid How to use a datagridview to add/update/edit rows deactive datagridview cell select Windows Service - Does not work outside of debug !! blue mask over icon Sign ClickOnce Bootstrapper? |
|||||||||||||||||||||||