Hi,
I have made a DLL in VB and I would like to know how to call the functions and access the properties in that DLL. If anyone can point me in the right direction, I would greatly appreciate it.
Thanks,
Barry
Posted on 2002-11-11 20:54:03 by bgong68
What? you made a .dll in visual basic and want to use it
in assembly? doesn't that kinda defy the purpose?

IMHO, Wouldn't that just create a bottleneck?
EDIT: And you will also need to use the Microsoft Visual Basic Virtual Machine!
(Visual Basic Run-Time .dll: MsvbvmXX.dll)

Anyhow, I am no expert on using external .dll's made in vb.
But this is how I would load an external .dll:
[color=sienna]

.data
DLL_LIBRARY DB "NAMEOF.DLL",0
DLL_FUNCTION DB "NameOfMyFunction",0
.data?
hLoadLib DD ?
.code
invoke LoadLibrary,ADDR DLL_LIBRARY ;[color=green]\\ Load the dll and get it's handle[/color]
mov hLoadLib,eax
invoke GetProcAddress,hLoadLib,ADDR DLL_FUNCTION ;[color=green]\\ Get address to function[/color]
invoke eax, [color=red]<- parameters to the function goes here[/color]
invoke FreeLibrary,hLoadLib ;[color=green]\\ Free the library when your done.[/color]
[/color]
Posted on 2002-11-11 21:45:35 by natas
Hi Natas,
Thanks for your help. I was able to use your code example and make it work when I call an Assembly DLL but I was still having trouble with the VB DLL. I am sure with a little more studying I will be able to get it to work.
Thanks,
Barry ^_^
Posted on 2002-11-12 19:29:27 by bgong68
VB doesn't create "standard" dlls, it creates ActiveX dlls (COM dlls) which AFAIK you can't use LoadLibrary/GetProcAddress on them. Check out Ernies page on COM in MASM:
http://ourworld.compuserve.com/homepages/ernies_world/a.htm

But WHY would you want to call a VB COM dll from Assembly? A lot of overhead don't ya think? Plus you have to redistirbute the vb runtimes with your apps. That is why I left VB for assembly... plus it is more fun :-)
Posted on 2002-11-12 19:46:39 by Gunner
Hi Gunner,
Thanks for the info. I was just looking thru my VB books and just recently discovered what you are telling me. That explains why I was having so much trouble. I created a DLL in Assembly that performs a task and wanted to add a Progress Dialog to it to show how much of the task was being completed. I am NEW to Assembly so it seemed natural to me to create the Progress Dialog in VB and then try to call it from the Assembly DLL. I am looking forward to trying to learn how to create the Progress Dialog in Assembly. I would greatly appreciate it if you can point me in the right direction on this site.
Thanks,
Barry ^_^
Posted on 2002-11-12 22:56:55 by bgong68
There is a strip of buttons at the top of most pages on this board, click the search feature and search away!

If you have the Platform SDK you can go right to the section on Progress Bars:
ms-help://MS.PSDK.1033/shellcc/platform/commctls/progbar/reflist.htm

Read the tuts at:
http://win32assembly.online.fr/

The search feature of the board is your best friend.
Posted on 2002-11-12 23:10:14 by Gunner