Using Dll visual basic in purebasic

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Using Dll visual basic in purebasic

Post by Kwai chang caine »

Hello at all

Excuse my very bad english
When i was a young boy, i was not good at the school in english lessons
I regret now :oops:

I try to use a DLL visual basic in pure basic.

Use Dll Pure in VB works very good, but the opposite, I do not do this. :?

This is the code of the DLL VB (VbAddition.dll)

Code: Select all

Public Function VbAddition(a, b)
 MsgBox "Coucou"
 VbAddition = a + b
End Function
This is the code of the executable Pure

Code: Select all

If OpenLibrary(0, "VbAddition.dll") 
 a = CallFunction(0, "VbAddition", 2, 3) 
 MessageRequester("Addition", Str(a), #MB_OK) 
 CloseLibrary(0) 
Else
 MessageRequester("Erreur", "La Dll VbAddition est absente", 0) 
EndIf
Thank you very much for your help 8)
I wish you a good day
ImageThe happiness is a road...
Not a destination
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

VB did not generate a 'normal' standard DLL.
It generates a ActiveX.DLL .
You can't call them directly with purebasic's Lib-Commands.
same in VB, if you wanna call another VB-DLL, you have to
make a reference on it, no way with the Declare as Lib commands.
But since a couple of weeks, Pure can use a nifty lib/Commandset

PureDispHelp
which makes it easy to use ActiveX.DLL's .
Look this thread for
SPAMINATOR NR.1
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Post by Kwai chang caine »

Hello rings
nice to talk you.

I'm looking PureDispHelp and the great lib

Thank you very much sincerely for your help.
I wish you a very good day
ImageThe happiness is a road...
Not a destination
Post Reply