Cool unmentioned Pb feature

Share your advanced PureBasic knowledge/code with the community.
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Cool unmentioned Pb feature

Post by Nik »

First we have to thank Fred for making the Compiler produce a .lib file when compiling as dll. And thanks for the import function because now we cann do the following:
This code is compiled as DLL for example with pb 3.94

Code: Select all

 ProcedureDLL MakeSth(Val.l)
  MessageRequester("TeHTEst",Str(Val.l))
 EndProcedure
Now we copy the NameofDLL.lib file int the directory of the sourcode for our Version 4.0 program.

Here is the code we right in 4.0 to use the function from 3.94

Code: Select all

Import "NameofDLL.lib"
MakeSth(Val.l)
EndImport

MakeSth(45)
Thats an absolutley WOW Feature I think
freak
PureBasic Team
PureBasic Team
Posts: 5944
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Keep in mind that the program will still require the dll to run. the generated .lib is only an import library (wrapper to the dll)
quidquid Latine dictum sit altum videtur
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

As an alternative one could use Prototypes :wink:
DarkDragon
Addict
Addict
Posts: 2345
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Cool unmentioned Pb feature

Post by DarkDragon »

Nik wrote:Thats an absolutley WOW Feature I think
WOW sucks! GPI and Epyx have gone because of it. :x

But the feature is nice, yeah :)
bye,
Daniel
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

yes really useful, i like this feature a lot.


ps: what WOW means ? (i don't understand, i'm french)
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

World of Warcraft :)
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

freak wrote:Keep in mind that the program will still require the dll to run. the generated .lib is only an import library (wrapper to the dll)
To get around that, you can use the PBOSL library to call function in memory, thus include the dll in a user library that wraps that library of sorts ...
Bonne_den_kule
Addict
Addict
Posts: 841
Joined: Mon Jun 07, 2004 7:10 pm

Post by Bonne_den_kule »

Polo wrote:World of Warcraft :)
The new weapon of mass destruction, together with dick cheney.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Re: Cool unmentioned Pb feature

Post by va!n »

DarkDragon wrote:
Nik wrote:Thats an absolutley WOW Feature I think
WOW sucks! GPI and Epyx have gone because of it. :x
What? GPI and Epyx left PureBasic? :roll:
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Post Reply