weird. Caching of Extern commands?

BlitzMax Forums/BlitzMax Programming/weird. Caching of Extern commands?

Grey Alien(Posted 2006) [#1]
I have been using a few different Win32 functions in a project. Then I made a brand new bmx file and called a Win32 function without declaring it first with Extern. I'm also not including any source files. For example

SetClassLongA(TheWindow,-14,icon)


This compiles on its own as a full program! How can it do that?
If I add this line:
abc()

it won't compile as it says "identifier abc not found", fair enough.

It's almost like the the extern declarations are cached by BlitzMax or something. What's going on?


Dreamora(Posted 2006) [#2]
Some core commands are already in the BM libraries used and thus externed in one of the BRL / PUB modules.


TartanTangerine (was Indiepath)(Posted 2006) [#3]
A lot of the Win32 functions are already declared.

Btw, using API specific stuff is going to make a Mac port of your next game a complete nightmare!


N(Posted 2006) [#4]
Check Pub.Win32's user32.bmx.

You're just redefining functions that were already extern'd.


TomToad(Posted 2006) [#5]
What E said: Line 1471


Grey Alien(Posted 2006) [#6]
I figured it might be something like that, but how come when I posted a tutorial here:

http://www.blitzbasic.com/Community/posts.php?topic=58571

that was originally missing the definition for setclasslonga, it worked on my PC but not TonyG's hence his comment

TonyG
'Identifier setclasslonga not found'


weird.


Grey Alien(Posted 2006) [#7]
Indiepath:
Btw, using API specific stuff is going to make a Mac port of your next game a complete nightmare!
yeah but it's all in one place (in my TGame object) and I'll make a MacFlag Const and just run some different code to set the icon and add a minimise button etc. (if I can figure out how the hell to do that on a Mac!)


TartanTangerine (was Indiepath)(Posted 2006) [#8]
I gotta ask : Why bother with all this API specific stuff? what are you trying to achieve?


Grey Alien(Posted 2006) [#9]
well, like I just said, I need an icon in the top left, can't do it without API calls. Need a minimise icon in the top right, again needs API calls. Know any other way to do this in Max, no? Thought so ;-)


Yan(Posted 2006) [#10]
I'll make a MacFlag Const and just run some different code to set the icon and add a minimise button etc.
No need to set a constant, use compiler directives.


Grey Alien(Posted 2006) [#11]
How Extraordinarily useful!