Restored from previous forum. Originally posted by Serge Lavigne.
Hi everybody
Is it possible to write a DLL in PureBasic
If so I would like to see a simple one in source code
TIA
Serge
jondo
DLL in PureBasic
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by freak.
Hi,
Yes it is possible, and very simple.
Just write a procedure like this:
Now set Executable format (under compiler Options in the Editor) to 'Shared DLL'
After compilation, you'll have a file called 'purebasic.dll' in the PBcompiler-Directory, that's all.
A problem is that the compiler adds a '_' to the procedure's name.
So when calling your DLL, it should look like _Whatever .
That's it, hope it helps...
Timo
--
A debugged program is one for which you have not yet found the conditions that make it fail.
Hi,
Yes it is possible, and very simple.
Just write a procedure like this:
Code: Select all
ProcedureDLL Whatever(agrument1.l, argumen2.l)
; do whatever
EndProcedure
After compilation, you'll have a file called 'purebasic.dll' in the PBcompiler-Directory, that's all.
A problem is that the compiler adds a '_' to the procedure's name.
So when calling your DLL, it should look like _Whatever .
That's it, hope it helps...
Timo
--
A debugged program is one for which you have not yet found the conditions that make it fail.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Serge Lavigne.
jondoHi,
Yes it is possible, and very simple.
Just write a procedure like this:Now set Executable format (under compiler Options in the Editor) to 'Shared DLL'Code: Select all
ProcedureDLL Whatever(agrument1.l, argumen2.l) ; do whatever EndProcedure
After compilation, you'll have a file called 'purebasic.dll' in the PBcompiler-Directory, that's all.
A problem is that the compiler adds a '_' to the procedure's name.
So when calling your DLL, it should look like _Whatever .
That's it, hope it helps...
Timo
--
A debugged program is one for which you have not yet found the conditions that make it fail.
Many thanks for your clear explanation
Serge