Author Topic: Why does resource-file need to contain systemconstants?  (Read 7769 times)

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Why does resource-file need to contain systemconstants?
« Reply #15 on: July 02, 2012, 09:08:49 PM »
how 'bout...
"AsLittleCasPossible"
or...
"TheLessCtheBetter"
or, if you like short...
"IH8C"

 :P

NoCforMe

  • Guest
Re: Why does resource-file need to contain systemconstants?
« Reply #16 on: July 10, 2012, 05:24:05 AM »
Except that I don't really H8 C. (I just pity the poor C programmer ... nah, not really.)

Maybe I should use "I [heart] ASM" or something. (Vanity license plate?)

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: Why does resource-file need to contain systemconstants?
« Reply #17 on: July 10, 2012, 05:25:53 AM »
CsuX   :lol:

how about a bumper sticker....
"Honk if you hate C"
or
"My other language is Assembler"

xanatose

  • Member
  • ***
  • Posts: 385
Re: Why does resource-file need to contain systemconstants?
« Reply #18 on: July 16, 2012, 03:48:55 PM »
The reason is that M$ decided it to be so. The Borland resource compiler didn't need the headers.

However, given that windows have evolved, I think that M$ did the right thing.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6662
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Why does resource-file need to contain systemconstants?
« Reply #19 on: July 16, 2012, 08:31:07 PM »
While I confess I am getting rusty with C, I don't have this religious fervor when it comes to writing code and if you use Windows, you are using a hell of a lot of code written in C and to a lesser degree, C++.

Now if this was a Unix forum, you would have the devotees frothing at the mouth over such heresies as not bowing down and worshipping the great god of C and they would be devising a Holy War against such infidels such as banishing you to a JAVA forum so that you could not partake of the religious virtues handed down by the great god of C. Now if the transgression was extreme enough, even the JAVA gods would be offended and they would in turn banish you to a HTML forum.

Fortunately for such infidels, Microsoft could not care less as long as you BUY Windows and even if you utter great and terrible heresies such as not worshipping the great god of C, you can always join the MASM forum.  :P
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

NoCforMe

  • Guest
Re: Why does resource-file need to contain systemconstants?
« Reply #20 on: July 17, 2012, 08:49:54 AM »
Honestly, when it comes to programming languages, I'm not religious either. Not zealously in favor of assembly language, not a h8r of higher-level languages like C.

Ackshooly, C is about as close to assembly language as you can get; it's actually pretty low-level as so-called HLLs go. Some statements actually map 1-to-1 to assembly code. Others are so close that it hardly matters. Plus for those people who use the high-level constructs in MASM32, like if/elseif, loops, etc., the code that actually gets generated isn't a whole lot different than the corresponding C constructs. It all gets boiled down to jumps, dontcha know.

I used to write COBOL, a language much maligned in the programmer "community". However, I still say that it was the best tool to use for the jobs I was tasked with doing. To all the detractors of COBOL, I challenge them to write an understandable and, more importantly, maintanable payroll application in C++, Pascal or whatever.

mywan

  • Guest
Re: Why does resource-file need to contain systemconstants?
« Reply #21 on: July 17, 2012, 11:46:34 AM »
I may be awfully green in assembly but this question has an obvious answer to me. I got accustomed to using the values directly, without the named variables, a lot in high level scripting languages. Especially given that some of these scripting languages don't even strip the unused portions of the includes. That leaves an awful lot of orphaned globals in the name of adhering to standards of waste.

In fact not even the resource compiler knows the constants by number. It merely passes on whatever number you provide for windows to make sense of. Windows can also directly interpret certain named arguments, but many parameters require the number itself.

In effect the question is a bit like asking why you need a phone book when the phone company already knows everybody's phone numbers. In this case the phone numbers are to call the right department in windows to get windows resources allocated to your program. If you want to use numbers instead of names you need no include for the names, but that doesn't mean the compiler knows what they mean either. Only windows knows when they are passes uninterpreted (unchanged) to windows.
« Last Edit: July 17, 2012, 12:16:52 PM by hutch-- »