Using dll's in pb.
Using dll's in pb.
Can anyone give me an example of loading dll in purebasic but you would be helping me if you give the source of the dll too, otherwise you would not be helping me. The example could be of any size.
- Kwai chang caine
- Always Here
- Posts: 5494
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: Using dll's in pb.
The more simple example i can write, it's a good question for me...because i can't do more
It's just for you
Code of EXE
Code of DLL

It's just for you

Code of EXE
Code: Select all
If OpenLibrary(0, "HamzaDLL.dll")
NumberOfMsgBoxHamza = 5
Back = CallFunction(0, "FunctionOfHamza", NumberOfMsgBoxHamza)
MessageRequester("Return of the DLL", "Ok...i have writen " + Str(Back) + " msgbox")
CloseLibrary(0)
EndIf
Code: Select all
ProcedureDLL FunctionOfHamza(NumberOfMsgBoxHamza.l)
For i = 1 To NumberOfMsgBoxHamza
MessageRequester("I write Hamza", "Hello i'm Hamza and i create this msgbox " + Str(i) + " times")
Next
ProcedureReturn i - 1
EndProcedure

Not a destination
Re: Using dll's in pb.
First of all, i'm really sorry for late respond. http://www.purebasic.fr/english/posting ... 3&p=300125Kwaï chang caïne wrote:The more simple example i can write, it's a good question for me...because i can't do more![]()
It's just for you![]()
Code of EXECode of DLLCode: Select all
If OpenLibrary(0, "HamzaDLL.dll") NumberOfMsgBoxHamza = 5 Back = CallFunction(0, "FunctionOfHamza", NumberOfMsgBoxHamza) MessageRequester("Return of the DLL", "Ok...i have writen " + Str(Back) + " msgbox") CloseLibrary(0) EndIf
Code: Select all
ProcedureDLL FunctionOfHamza(NumberOfMsgBoxHamza.l) For i = 1 To NumberOfMsgBoxHamza MessageRequester("I write Hamza", "Hello i'm Hamza and i create this msgbox " + Str(i) + " times") Next ProcedureReturn i - 1 EndProcedure
Secondly, very very thankyou. Actually, i know how to do that, but when i create the dll in jaPBe (i don't have pure basic full version), and then when i call the function in purebasic, it returns 0.
Well man, again very very Thanks for your time.
Hey man! Please stay in contact with me, as i don't have any other friend on purebasic forums. It will be the most appriciated.
Thanks.
Your friend,
Hamza,
Asone Corp.