CVS ?, residents ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

CVS ?, residents ?

Post by Psychophanta »

I know waht mean Interfaces in PB, but please:
What mean CVS? and residents?
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Post by helpy »

CVS = Concurrent Versions System (more info on www.cvshome.org)

Residents (folder .\PureBasic\Residents) contain (in compiled form) definitions like constants, structures and interfaces.

cu, helpy
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Thanx, helpy. :)
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Hi all,

I have read what I can find on Residents and still don't really understand the why and wherefor of them.

Could somebody explain (in a simple way understandable by a simple mind) what these do, their benefits and etc.

And a maybe-maybeNot-related Q - Do libraries have an industry standard format. For eg, could a PB library work with masm, or vice versa?

Thanks.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

This is a PB specific thing. A .res file (found in the Residents folder of PB)
contains definitions of constants, structures or interfaces. The compiler reads
those, and automatically knows all the structures/constants/interfaces, that
are in there, without the need to write them in your code.
Kind of like a C header file that always get's included.

For example, there is the PureBasic_x86.res . It contains all of PB's own
constants. Remove it, and it won't recognize any of the flags for the commands.
There is also one for the WinAPI stuff, and for win32 interfaces and DirectX interfaces.

You can create your own .res file, if you have often used constants for example,
that you don't want to type all the time.
Just create a normal .pb file with them, and run the commandline compiler
like this:

pbcompiler.exe source.pb /RESIDENT residentfile.res

then, move the created .res file to the residents folder, restart PB, and
the compiler should know all your stuff.


About the libraries:
The files follow no standart. You can only use them with PB.

If you have a library in *.obj or *.lib format, you can turn it into a PB
library with the LibraryMaker tool (in LibrarySDK folder), but only if it's
functions are named properly (PB_ prefix for the functions). See the
LibrarySDK for more details.

Timo
quidquid Latine dictum sit altum videtur
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Okay, I think maybe the penny has dropped. (Finally :))

Thank you, I really appreciate that. :)
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> pbcompiler.exe source.pb /RESIDENT residentfile.res

Hmm, I tried to create a resident file with #MB_SETFOREGROUND but the
compiler complains that this constant is unknown... but the following works:

Code: Select all

Debug #MB_SETFOREGROUND ; Returns 65536
How can compiling an app with it work, yet creating a residents file doesn't?
I've been using this constant in all my apps like the following, but I'd prefer
it to be a resident: #MB_SHOW=#MB_SETFOREGROUND|#MB_TASKMODAL
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

When creating a resident file, the compiler doesn't load any other resident files,
so it doesn't know the value of that constant.

You must put the constant value as a number there.

Timo
quidquid Latine dictum sit altum videtur
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Thanks Freak, it works now. :)
Post Reply