Author Topic: Resource.h: where is RCDATA?  (Read 499 times)

jj2007

  • Member
  • *****
  • Posts: 8823
  • Assembler is fun ;-)
    • MasmBasic
Resource.h: where is RCDATA?
« on: August 17, 2018, 10:09:12 AM »
Unfortunately, this builds just fine, without errors:
Code: [Select]
#include "resource.h"
99 RT_RUBBISH "somefile.gif"

But it doesn't run as expected: It needs, precisely, RCDATA (and not RT_RCDATA or RC_DATA).

The problem here is that the resource compiler does not complain about wrong spellings; which leads to unnecessary bug chasing sessions :(

The only references to that family of constants in resource.h are these:

Code: [Select]
#define VS_FILE_INFO RT_VERSION
#define RT_MANIFEST 24

Are the other ones defined somewhere else, or are they built into the resource compiler?

Btw our friends in Richmond have these to offer:

Resource Types
Quote
RT_RCDATA
MAKEINTRESOURCE(10)

RCDATA resource
Quote
Defines a raw data resource for an application. Raw data resources permit the inclusion of binary data directly in the executable file.

syntax
nameID RCDATA  [optional-statements] {raw-data  ...}

Perfect, isn't it? Both build fine, but 99 RCDATA "somefile.gif" and 99 10 "somefile.gif" work, RT_RCDATA fails.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5896
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Resource.h: where is RCDATA?
« Reply #1 on: August 17, 2018, 11:01:14 AM »
 :biggrin:

RC.EXE is also a friendly PIG, get it wrong and it dumps garbage in your directory. Solution is to get it right. RC.EXE does not hold your hot little hand either.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jj2007

  • Member
  • *****
  • Posts: 8823
  • Assembler is fun ;-)
    • MasmBasic
Re: Resource.h: where is RCDATA?
« Reply #2 on: August 17, 2018, 11:28:56 AM »
Hutch,

Don't worry, you don't have to hold my hot little hand, I'm a grown-up. I am just flagging a potential source of wasting our members' precious time due to
a) rc.exe not throwing errors where it should and
b) ambiguous or plainly wrong MSDN documentation.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5896
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Resource.h: where is RCDATA?
« Reply #3 on: August 17, 2018, 11:41:52 AM »
Its a bit late, RC.EXE has been a pig for the last 30 years.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: