473,796 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Declare Statement

Hi,

Instead of adding my own custom dll's as references into my project, I want
to call it via declare statement. However, I'm having a few difficulties!

My dll contains a basic function :

Public Class MyDLL
Public shared function MyTestFunction (byval mystr as string)
try
return mystr & "Success"
catch ex as exception
msgbox("There has been an error!")
end try
End Function
End Class

My Test Application contains:

Module Main
Private Declare Auto Function MyTestFunction _
Lib "DLL Example.dll" _
Alias "MyTestFunction " _
(ByVal MyStr as String)

Sub Main()
MsgBox(MyTestFu nction("Test was : "))
End Sub

End Module

An exception is thrown telling my that its "unable to find an entry point"
into the dll "DLL Example.dll"

Should I be doing something else within my dll to expose the function
(exported)?

Or am calling the dll within my application incorrectly?

SSO.

Nov 20 '05 #1
7 1464
"Simon Osborn" <so*****@micros oft.com> schrieb

Instead of adding my own custom dll's as references into my project,
I want to call it via declare statement. However, I'm having a few
difficulties!


You can not write Standard DLLs with VB.NET. Set a reference to the assembly
in the project that requires the assembly. We live in an OO world nowadays.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
Cor
Hi Armin,

Again an OT and it is not only ment for you.

But you did write a little bit what I was thinking when I saw your last
messages.

I think (but I can be wrong), calling only API's, making a Webbrowser Helper
using only handles, making Dll librarys etc, is'not using VB.net but trying
to make things you never could do because you had to use C++. But now that
VB is OO it looks if some people are thinking that C++ is the same as
VB.net, try it and ask here.

In past I saw a lot of messages who told people to turn to the Asp.net group
while they where really writing VB language. Now I saw a very nice message
from Dimitry who told someone that he had a better change in the
dotnet.framewor k.interop newsgroup. And I did very much agree with him (Very
nice said of course by Dimitry).

But I can be wrong with my thought, what is your opinion?

Cor
Nov 20 '05 #3
"Cor" <no*@non.com> schrieb
Hi Armin,

Again an OT and it is not only ment for you.

But you did write a little bit what I was thinking when I saw your
last messages.

I think (but I can be wrong), calling only API's, making a Webbrowser
Helper using only handles, making Dll librarys etc, is'not using
VB.net but trying to make things you never could do because you had
to use C++. But now that VB is OO it looks if some people are
thinking that C++ is the same as VB.net, try it and ask here.

In past I saw a lot of messages who told people to turn to the
Asp.net group while they where really writing VB language. Now I saw
a very nice message from Dimitry who told someone that he had a
better change in the dotnet.framewor k.interop newsgroup. And I did
very much agree with him (Very nice said of course by Dimitry).

But I can be wrong with my thought, what is your opinion?

Cor


I read your post three times but, sorry again, I don't get the core (not Cor
;-) ) statement. Is it about posting to the right group, using pInvoke, or
whatever?
--
Armin

Nov 20 '05 #4
* "Armin Zingler" <az*******@free net.de> scripsit:
I read your post three times but, sorry again, I don't get the core (not Cor
;-) ) statement. Is it about posting to the right group, using pInvoke, or
whatever?


The post contains some "thoughts".

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* "Cor" <no*@non.com> scripsit:
Again an OT and it is not only ment for you.
;-)
I think (but I can be wrong), calling only API's, making a Webbrowser Helper
using only handles, making Dll librarys etc, is'not using VB.net but trying
to make things you never could do because you had to use C++. But now that
ACK. .NET is not the preferred environment dordeveloping things like
this. I would use VC++ or VB Classic für these purposes.
VB is OO it looks if some people are thinking that C++ is the same as
VB.net, try it and ask here.
That's a really big problem. Most people think that with the release of
VB.NET, VB isn't a "toy language" any more and they can write drivers
and other low-level stuff with it.
In past I saw a lot of messages who told people to turn to the Asp.net group
while they where really writing VB language. Now I saw a very nice message
They were _using_ the VB.NET language. If I am working with an old COM
component in VB.NET, this group isn't the right place for placing the
questions about the COM component too. In this case, like in the case
of ASP.NET, VB.NET is only the tool. The question is _very often_ not
related to the programming language itself.
from Dimitry who told someone that he had a better change in the
dotnet.framewor k.interop newsgroup. And I did very much agree with him (Very
nice said of course by Dimitry).


:-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Cor
Hi Herfried,
They were _using_ the VB.NET language. If I am working with an old COM
component in VB.NET, this group isn't the right place for placing the
questions about the COM component too. In this case, like in the case
of ASP.NET, VB.NET is only the tool. The question is _very often_ not
related to the programming language itself.


The big difference in using ASP.NET webforms and classic internet with COM
is that with ASP.NET forms you use completly VB.net language exactly in the
same way as with windowform. (While the controls and some other things are
different and needs another approach)

Cor

Nov 20 '05 #7
* "Cor" <no*@non.com> scripsit:
They were _using_ the VB.NET language. If I am working with an old COM
component in VB.NET, this group isn't the right place for placing the
questions about the COM component too. In this case, like in the case
of ASP.NET, VB.NET is only the tool. The question is _very often_ not
related to the programming language itself.


The big difference in using ASP.NET webforms and classic internet with COM
is that with ASP.NET forms you use completly VB.net language exactly in the


Sorry, I was not talking about ASP + COM, I was talking about the
difference between the programming language as a tool for using other
_technologies_ like p/invoke, COM, Windows Forms, ASP.NET, ADO.NET,
Remoting, ...

Yes -- language and technologies are overlapping, for example p/invoke
and VB.NET, ...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8

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

Similar topics

5
4610
by: Sakharam Phapale | last post by:
Hi All, How to declare the following statement in following structure. szPname As String * MAXPNAMELEN Public Structure MIXERCAPS public wMid As Integer public wPid As Integer public vDriverVersion As Long
5
2374
by: iwdu15 | last post by:
hi, i need to have a declare statement for an API to call a method in it, the only problem is that i dont neccessarily know where on the comp it will be. I kno it will be in my application folder, but how do i say that in the declares statement? for instance, i have this Private Declare Sub AccCreateSession Lib "acccore.dll" Alias "#111" _ (<MarshalAs(UnmanagedType.LPStruct)ByVal Name As Guid, <MarshalAs(UnmanagedType.IDispatch)ByRef...
6
7786
by: John Bailo | last post by:
I created a sproc with 3 input parameters and one output parameter. I want to test it in the "Run SQL Scripts" app of Navigator. I wrote this code: DECLARE RTNDATE CHAR(10) DEFAULT ''; CALL MANLIB.MANDATCL('ADD','20060101','1',RTNDATE) SELECT MYVAR;
2
13460
by: juan.gautier | last post by:
Hi, I try to construct a SQL code for a view to select a specific data from a table, this query take the value of the filter from a text box in a visual basic 6.0 form. my problem is when i DECLARE the variable @AMP receive a error message that said "The Declare cursor SQL construct or statement is not supported." What i do wrong? Please help me. i attach the code. DECLARE @AMP int;
1
3785
by: okonita | last post by:
Hi all, My environment is DB2 UDBv8.2 on Windows and Linux. I am getting a lot of errors on the script you see below. Some of the error I am geting are: -----------------------------------Start of Script----------------------------------- ---------------------original creation by Norm Wong------------------------ CREATE PROCEDURE DB2ADMIN.REORGTS( ) DYNAMIC RESULT SETS 1
0
9531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.