NO

Author Topic: Using rc.exe and porc.exe  (Read 4651 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Using rc.exe and porc.exe
« on: May 08, 2013, 06:48:50 PM »
What we think to happen when compiling this with rc.exe/porc.exe ?
test.c
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef RC_INVOKED
LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

1001 DIALOGEX DISCARDABLE 6, 18, 210, 142
STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Dialog"
FONT 8, "Tahoma", 0, 0, 1
{
  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 160, 5, 45, 15
  CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 160, 23, 45, 15
}
#endif
EDIT: filename to test is something like test.c
« Last Edit: May 09, 2013, 08:47:06 AM by timovjl »
May the source be with you

Offline Vortex

  • Member
  • *
  • Posts: 865
    • http://www.vortex.masmcode.com
Re: Using rc.exe and porc.exe
« Reply #1 on: May 08, 2013, 08:56:20 PM »
Hi Timo,

It looks like that the RC_INVOKED option is assumed to be activated for both of the resource compilers.
Code it... That's all...

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Using rc.exe and porc.exe
« Reply #2 on: May 09, 2013, 10:25:05 AM »
It's a predefined macro of resource compiler.
The scope is to filter parts of file (typically headers included in rc files) that could not, or must not, be compiled by resource compiler.
See http://msdn.microsoft.com/en-us/library/windows/desktop/aa381032(v=vs.85).aspx
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Using rc.exe and porc.exe
« Reply #3 on: May 09, 2013, 10:40:18 AM »
But why RC_INVOKED is omitted if filename ends .c ?
Any documentation for that ?
May the source be with you

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Using rc.exe and porc.exe
« Reply #4 on: May 09, 2013, 11:07:08 AM »
I don't understand your point.
You mean that if you create a .c file and feed it to porc or rc the symbol RC_INVOKED is omitted?
For both resource compilers?
I can only immagine that C compiler and resource compilers share the same preprocessor that in turn uses file extension to tune its own behaviour. Should be so it seems a kind of bug unless there is some more complicate and strange strategy due to visual programming (stdafx, MFC, ATL, etc).
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide