Page 1 of 3

Bcc72 Prsht.h resource compile error

Posted: Thu Oct 27, 2016 4:55 pm
by Rick Lipkin
To All

Just downloaded Bcc72 32 bits and like Bcc70 ( which I have a fix for ) I get a compile error with prsht.h about an out of balance #if and #endif. I was hoping someone has run accross this error and has a fix for the header file mismatch. I would be very grateful.

[1]:Brc32.Exe -r -foResource\VehW32.Res VehW32.RC
Borland Resource Compiler Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation. All rights reserved.
Error prsht.h 917 1: '#endif' before '#if'

Rick Lipkin

Re: Bcc72 Prsht.h resource compile error

Posted: Fri Oct 28, 2016 2:51 pm
by Enrico Maria Giordano
Can I see a sample showing the error to test here?

EMG

Re: Bcc72 Prsht.h resource compile error

Posted: Fri Oct 28, 2016 3:53 pm
by carlos vargas
Please search into he forum, this topic is resolved. sorry for my bad english.
http://forums.fivetechsupport.com/viewtopic.php?p=147360#p147360

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 1:25 pm
by Rick Lipkin
Carlos

Thanks for reminding me of my own solution .. I did not research this fix since the files are so different. Let me see if removing the trailing \ from line 184 does the trick for Bcc72.

Thanks
Rick Lipkin

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 1:44 pm
by Rick Lipkin
Enrico

Just try to compile a .rc file with the line below ( or buildx.bat that includes an .rc ) and that will evoke the error. Bcc72 is a bit different than Bcc70 in that that the .H files are in two different folders complicating the compile a bit.

Windows.h is in \Bcc72\INCLUDE\windows\sdk and
String.h is in \Bcc72\INCLUDE\windows\crtl

Don't really know if using Bcc72 is any better than Bcc70 ?

Rick Lipkin

Code: Select all | Expand


C:\BORLAND\BCC72\BIN\brc32 -r %1.rc
 

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 1:47 pm
by Enrico Maria Giordano
What is prsht.h for? I never used it.

EMG

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 1:51 pm
by Rick Lipkin
Enrico

I have no clue .. somehow Prsht.h is evoked by Brc32.exe when compiling a .rc file.

Rick Lipkin

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 2:00 pm
by Enrico Maria Giordano
No, it doesn't. At least, I never saw that error myself.

EMG

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 2:58 pm
by Rick Lipkin
Enrico

I use the below modified Rc2Dll32.bat file that copies all my .rc to a single .rc and then compiles to .res. The line below fails twice :

Code: Select all | Expand


@Echo Off
rem RC file to 32 bits resources DLL
rem syntax: rc2dll32.bat Your_rc_file  !!! without the .RC extension

DEL VehW32.DLL
DEL VehW32.RC
DEL Veh3W2.RES

COPY *.RC VehW32.RC

C:\BORLAND\BCC72\BIN\brc32 -r %1.rc

del *.iL?
del *.map
del *.obj
del *.~rc
del *.rws
:del *.res
del *.tds
echo done!
 

The result of the batch file is

Code: Select all | Expand


WORKVEH.RC
WOTIRE.RC
WRKADD.RC
xplook.rc
        1 file(s) copied.
Borland Resource Compiler  Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation.  All rights reserved.

Error prsht.h 917 1: '#endif' before '#if'
done!
 


To fix in line 184 of Prsht.h remove the trailing /

LPFNPSPCALLBACKW pfnCallback; \
UINT *pcRefParent; // \ <--- remove trailing backslash line 184

ReRun the batch file again and you get this error:

Code: Select all | Expand


WORKVEH.RC
WOTIRE.RC
WRKADD.RC
xplook.rc
        1 file(s) copied.
Borland Resource Compiler  Version 5.40
Copyright (c) 1990, 1999 Inprise Corporation.  All rights reserved.

Error combaseapi.h 283 9: Symbol PURE is already defined. Redefinition is not the same
done!
 


To fix in line 283 of Combaseapi.h rem out the entire line
// #define PURE

Rerun the batch file and now I get a clean .res to compile into my application

Rick Lipkin

ps ... if I use the single VehW32.rc alone in my compile list ( instead of VehW32.res ) .. I get the same header file compile errors.

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 3:05 pm
by Enrico Maria Giordano
Still I don't understand what is the use of prsht.h and combaseapi.h. Never used nor needed them.

EMG

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 3:13 pm
by Antonio Linares
Rick,

What header files those RC files have ?

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 3:22 pm
by Rick Lipkin
Enrico

I do not know the answer to your question .. I do remember ( after Carlos jogged my memory ) having to rem out the trailing \ in Prsht.h in Bcc70 .. but following the "rabbit trail down the hole" with Bcc722 .. fixing Prsht.h lead to Combaseapi.h and rem'ing out line 283 makes the process work.

What is interesting to me is if I run Buildx.bat in the \samples with the modified Bcc72 path, there is no error compiling the associated .rc .. :?:

Maybe Antonio or Rao could chime in here and tell us what the two Bcc72 header files actually do.

Rick Lipkin

Re: Bcc72 Prsht.h resource compile error

Posted: Sat Oct 29, 2016 3:24 pm
by Rick Lipkin
Antonio

Using Resedit the following Include lines are embedded .. probably those are evoking the additional C++ header errors:

Code: Select all | Expand


// Generated by ResEdit 1.6.6
// Copyright (C) 2006-2015
// http://www.resedit.net

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"
 


I had to move to ResEdit as my forms editor because our 'beloved' Workshop is 16 bits and Workshop never embedded an Include file in the .rc

Rick Lipkin

Re: Bcc72 Prsht.h resource compile error

Posted: Mon Oct 31, 2016 7:53 am
by Antonio Linares
Rick,

Try removing this line:

#include <commctrl.h>

if that solves the problem, then you can modify the resource script template from Resedit preferences

Re: Bcc72 Prsht.h resource compile error

Posted: Mon Oct 31, 2016 1:16 pm
by Rick Lipkin
Antonio

I removed the #include <commctrl.h> from all my resources and that fixed the call to Prsht.h but the .rc compile still apparently is looking at combaseapi.h and errors out on line 283 with the symbol PURE already defined.

Rick Lipkin