IncludeLibrary / IncludeResident

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

IncludeLibrary / IncludeResident

Post by Flype »

IncludeLibrary "filename.pbi"

Like the IncludeFile / XIncludeFile command but,

- only the ProcedureDLL are recognized from the caller source.
- same rules/behaviour as the 'Windows DLL' compiler directive.



IncludeResident "filename.pbi"

- Same but for including only the Constants and Macros.



This might be useful for making 'cleaner' includes, wrappers and such.
:roll: :?:
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
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

or maybe - in a different way :

IncludeLibrary "filename.lib"
IncludeResident "filename.res"
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
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Honestly, imho the res files do got their purpose to be auto loaded when starting PB. But your purpose is to include them individually projectbased.
So a common include file containing Structures/Constants etc. could be/is enough?
IncludeLibrary "filename.lib"

Thats already the job of "Import/EndImport" which works ok - well if all which has to be linked also is present ;)


Quintessence: I think you cant wait (me also) for a final official release of Tailbite supporting v4 ? ;)
Check out OOP support for PB here!
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

hum, forget the second post... that's not useful at all.
inc. wrote:Quintessence: I think you cant wait (me also) for a final official release of Tailbite supporting v4 ? ;)
:cry: yesssss. :D
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
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

Resource files can already be included on a per-project basis via compiler options, no?

From the manual:
"Resources

Here you can include as many Resource scripts (*.rc files) as you want. They will be compiled and included with the executable. You can use any resource editor (for example the PellesC IDE) to create such scripts.

Note: Since Resources are a specific to the Windows platform only, PB does not include a Library to manage them and they are not further documented here. See documentation on the Windows API and resources for more information."
Import/EndImport works with .lib files, but I'm not sure if they statically linked or not. (Wish they were!)

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Amiga5k wrote: Import/EndImport works with .lib files, but I'm not sure if they statically linked or not. (Wish they were!)

Russell
You can use ResourceScripts *.rc in Compileroptions.
You can use compiled Resources *.res with Import, also *lib, *.obj
This is statically linked to your executable or dll
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Re: IncludeLibrary / IncludeResident

Post by Dummy »

Flype wrote:IncludeLibrary "filename.pbi"

Like the IncludeFile / XIncludeFile command but,

- only the ProcedureDLL are recognized from the caller source.
- same rules/behaviour as the 'Windows DLL' compiler directive.



IncludeResident "filename.pbi"

- Same but for including only the Constants and Macros.



This might be useful for making 'cleaner' includes, wrappers and such.
:roll: :?:
this idea is great and I'd love to have these features in PB ^^
Amiga5k
Enthusiast
Enthusiast
Posts: 329
Joined: Fri Apr 25, 2003 8:57 pm

Post by Amiga5k »

Ah, that's good to know!

Thanks!

Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Post Reply