|
-
Oct 14th, 2011, 03:50 AM
#1
Thread Starter
Member
[Help] VB6.0 How to add and use custom Dll file
Hey, Anyone know how to add a dll file to a vb6 program?
Im trying to add a dll for reading maplestory wz files. Its called MapleLib.dll, I have no idea at all how to go about adding it though. I also would like to know if theres anyway to view the functions the dll has without opening the source (its hosted in an google code repository and I dont have anything to download the source, I know theres programs out there but I find most of them to be a hassle to work with)
Anyway How Can I use a dll with my visualbasic program? and how do i find out the functions inside the dll
-
Oct 14th, 2011, 03:54 AM
#2
Re: [Help] VB6.0 How to add and use custom Dll file
If it is an ActiveX DLL, you can add a reference (via "Project"->"References"), then declare a variable of the apt type(s).
If it is a standard DLL, attempting to add a reference will fail. For these you need to know the functions before you can use them, so that you can specify them in a Declare statement.
-
Oct 16th, 2011, 05:44 AM
#3
Thread Starter
Member
Re: [Help] VB6.0 How to add and use custom Dll file
So If I were to find the function names how would i go about declaring them? Also If i had the source of the dll is it very hard to convert it to an activex? (Can i simply compile it differently? Im assuming its not that easy. But i doubt it hurts to ask)
Last edited by jasonmbrown; Oct 16th, 2011 at 06:20 AM.
-
Oct 16th, 2011, 05:55 AM
#4
Re: [Help] VB6.0 How to add and use custom Dll file
Does that mean you have already found out that it is not an ActiveX DLL? (if you haven't, do that first)
If it is a Standard DLL you need more than just the function names, you also need to know the data types of the parameters and the function return value (in terms of VB6, not the source language). Once you have all of that you use a Declare statement at the top of a code file, which be similar to this:
Code:
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
-
Oct 16th, 2011, 10:34 PM
#5
Thread Starter
Member
Re: [Help] VB6.0 How to add and use custom Dll file
Im quite positive its not an activex dll. Il double check though. And thankyou
Edit: Well i simply assumed it wasnt activex because I tried every way I know of to add it into vb and it said it wasnt a valid activex dll however is there a way to check? I have the source and its written for Visual C#, It states that its a class library but other then That I havent found anything referring to the type of dll that it is..
Last edited by jasonmbrown; Oct 16th, 2011 at 10:38 PM.
-
Oct 17th, 2011, 02:28 AM
#6
Re: [Help] VB6.0 How to add and use custom Dll file
Why did you edit your previous post after I replied to it? It's only luck that I have seen the changes, and I doubt that anyone else saw them either.
Now that you have mentioned that you checked (rather than just asking how to declare the functions), treat it as a standard DLL, and try to declare it as in the second half of my previous post. If you need help, show the function header in C#, and your attempt to declare it in VB6.
-
Oct 17th, 2011, 07:08 AM
#7
Thread Starter
Member
Re: [Help] VB6.0 How to add and use custom Dll file
K, and sry about editing. I didnt see your post. My internet sucks and doesnt update pages correctly most of the time.
Anyway Il try to get it working However I got no idea how to work with c or dll's but I believe using this dll would save me months of rewriting code :|.
Thanks for the Help, Il post again later if i need more
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
|