Page 1 of 1

Using Dll visual basic in purebasic

Posted: Thu May 24, 2007 9:17 am
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

Posted: Thu May 24, 2007 10:03 am
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

Posted: Thu May 24, 2007 12:37 pm
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