|
-
Aug 7th, 2000, 06:13 AM
#1
Thread Starter
Lively Member
hey, (like the subject line..lol)
i am having a bit of a problem with using my own DLL's in vb, I wrote it in VC++, and am trying to use it in vb, but i keep getting the error:
"Cant find DLL entry point in..."
now do you have any idea why this does that? Do you need to reference it or something? All i am doing to connect it to VB is add:
Code:
Private Declare Function add Lib "DLLTest.dll" (y As Integer, x As Integer) As Integer
in the general declarations, is this wrong? I dunno...
thanks
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Aug 7th, 2000, 07:18 AM
#2
Fanatic Member
It all depends on what sort of Dll it is.
First off though. Is the dll Registered on the system?
Next if it is an ActiveX or COM dll you should be able to reference the dll as an object, and use the dll like any other object in VB. You can create an instance of it using the CreateObject function, or use the New keyword when declaring it.
Good Luck.
Iain, thats with an i by the way!
-
Aug 7th, 2000, 07:57 AM
#3
Thread Starter
Lively Member
thanks...
erm it is a standard win32 dll made in VC++6, and so doesnt need registering, I have it in the applications folder, and it wont work, pls help me, i am desperate, well sorta! i am bored and want to do this, everytime that i make dlls i cant use them in vb (unless i make them in vb) so what am i doing wrong, i can use the dll in a console C++ app.. ???
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Aug 7th, 2000, 03:23 PM
#4
Thread Starter
Lively Member
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Aug 7th, 2000, 03:28 PM
#5
Monday Morning Lunatic
Can you post your C/C++ function prototype, please?
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 7th, 2000, 05:11 PM
#6
Thread Starter
Lively Member
Here is my simple function:
Code:
DLLTEST_API int add(int num1, int num2)
{
return num1+num2;
}
and i have declared it in the header as follows:
Code:
class DLLTEST_API CDLLTest {
public:
CDLLTest(void);
// TODO: add your methods here.
DLLTEST_API int add(int num1, int num2);
};
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Aug 7th, 2000, 05:23 PM
#7
Thread Starter
Lively Member
Has anyone else made or used DLL's made in other languages, or made as win32 DLLs? And did you get them to work in vb?
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Aug 7th, 2000, 05:28 PM
#8
I use a C++ dll in my VB program with no problem. I know very little about VC++, but I'm going to try and find the source and see if I can tell what the difference is with your code, but don't hold your breath.
-
Aug 8th, 2000, 05:43 AM
#9
Monday Morning Lunatic
The problem is that your function is inside a class, and consequently does not class (sorry ) as an entry point. If you used:
Code:
__declspec(dllexport) int test(int x, int y) {
return x + y;
}
And put the function into your .def file, it should work. VB has difficulty using C++ classes like that.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 8th, 2000, 12:47 PM
#10
cant you just add a reference to the file through the project menu and then initiate the class through code, like I do with my VB dll's?
-
Aug 8th, 2000, 05:10 PM
#11
Thread Starter
Lively Member
THANKS, i am sure it will work now, it is just i dont have a .def file?
Mag-Net's Home
Visual Studio 6-Enterprise - SP4
ICQ: 35519773
Have Fun 
-
Aug 9th, 2000, 04:54 PM
#12
Monday Morning Lunatic
It's a list of functions in your DLL. It's compiled in when you create it, I think.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
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
|