|
-
Mar 24th, 2003, 10:38 AM
#1
Thread Starter
Lively Member
Exporting functions in VB.NET
I'm trying to create a DLL in vb.net, only when I try to call the function in the dll, it says the entry point is not found. Obviously this is because I haven't exported the function I'm trying to call - I had the same problem when I started messing with dlls vc.
Anyway, how do you export a function from in vb .net?
Thanks
-
Mar 24th, 2003, 10:46 AM
#2
how are you declaring and calling this function?
-
Mar 24th, 2003, 10:48 AM
#3
Thread Starter
Lively Member
using a declare statement:
VB Code:
Declare Sub test Lib "d:\test.dll" (msg As String)
and then
-
Mar 24th, 2003, 10:56 AM
#4
cant do that . .NET dll's are not like API callable dll's. you have to first add a Reference by right clicking the project in the solution explorer and choose Add Reference. Find and check off the appropriate control. Then declare it,
Dim myobj as New namespace.classname
then
myobj.subroutinename.
-
Mar 24th, 2003, 10:57 AM
#5
Thread Starter
Lively Member
Oh right, I'd been told that you could export functions from them so you could use them in that way.
Ah well, never mind, thx neway
-
Mar 24th, 2003, 10:59 AM
#6
Addicted Member
So VB.NET DLLs are just like ActiveX DLLs?
Can you make "normal" DLLs in VB.NET at all?
If you can dream it, you can do it - Moo Power!
-
Mar 24th, 2003, 10:59 AM
#7
Someone lied to you.
-
Mar 24th, 2003, 11:00 AM
#8
Originally posted by Vitani
So VB.NET DLLs are just like ActiveX DLLs?
Can you make "normal" DLLs in VB.NET at all?
No. Still need to use C for that.
But at least you dont have to register dll's anymore.
-
Nov 5th, 2003, 10:02 AM
#9
New Member
I tried this but I keep getting this error
"File or assembly name myNetAssebly, or one of its dependencies, was not found."
When I referenced the assembly, I used the browse button to go to exact location where I have the dll.
Any idea?
Thanks
-
Nov 5th, 2003, 10:18 AM
#10
Addicted Member
Originally posted by laptop_01
"File or assembly name myNetAssebly, or one of its dependencies, was not found."
Looks like you have a typo int your code, do you not mean myNetAssembly?
If you can dream it, you can do it - Moo Power!
-
Nov 5th, 2003, 10:22 AM
#11
New Member
The typo is in the message I posted. I meant to type MyNetAssembly when I typed out the error message. The code is ok.
I would appreciate it if you have an idea to how to resolve this problem
-
Nov 5th, 2003, 10:23 AM
#12
Addicted Member
is this a compile, or run-time error?
If you can dream it, you can do it - Moo Power!
-
Nov 5th, 2003, 10:54 AM
#13
New Member
This is a run time error.
-
Nov 5th, 2003, 11:00 AM
#14
New Member
The run time error looks like this:
Run time error '-2147-24894 (80070002)':
File or assembly name myNetAssembly, or one of its dependencies, was not found
-
Nov 5th, 2003, 11:15 AM
#15
Addicted Member
is the DLL in the same folder as the exe that is referencing it?
If you can dream it, you can do it - Moo Power!
-
Nov 5th, 2003, 11:36 AM
#16
New Member
-
Nov 5th, 2003, 11:48 AM
#17
Addicted Member
hmm, does your DLL rely on any other DLLs outside of the .NET framework?
If you can dream it, you can do it - Moo Power!
-
Nov 5th, 2003, 03:37 PM
#18
New Member
yes
Sort of strange things. The C# DLL uses a legacy C DLL. Therefore, inside the C# DLL I have a lot DllImport lines. This woeks fine as long as I am writing a ,NET application that uses the C# DLL,
Now after deleting the C# DLL and recreating it again for sanity check, I can no longer add it to my VB 6.0 project (using the add reference dialog). I now get "Can't add reference to the specified file".
This is getting strange
-
Nov 5th, 2003, 04:21 PM
#19
yay gay
are you using your C# dll in a vb6 app? you have to compile it in a special way to it work properly..sometime ago i did that if you search the forum you will find some posts about it
\m/  \m/
-
Nov 5th, 2003, 04:27 PM
#20
New Member
Any chance you can remeber the link. I've been searching all day. No luck.
Thanks
-
Nov 5th, 2003, 04:38 PM
#21
You have to make the C# dll into a COM dll. I don't know where PT Exorcist's post is but there is a walkthrough in the help files titled 'Walkthrough: Creating COM Objects with Visual Basic .NET'. If there isn't one similar for C# then just translate that one.
-
Nov 5th, 2003, 04:39 PM
#22
-
Nov 6th, 2003, 06:45 PM
#23
New Member
Many thanks.
I was able to communicate with the .NET DLL fine. I am experimenting with argument passing now. Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|