How to convert .rc to .res

How to convert .rc to .res

Postby eddielum » Mon Apr 16, 2012 7:30 am

How to convert .rc to .res

This is my first program include .rc files.
I use Pelles C (replace my Borland Workshop 4.5) and build up a new .dll files. (It includes .h / .ppj / .ppx / .rc / .tag 5 files)
and i try to compile with test.mak

My test.mak file:

#Borland make sample, (c) FiveTech Software 2005-2009

HBDIR=c:\harbour
BCDIR=c:\bcc582
FWDIR=c:\fwh

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\
.path.CH = $(FWDIR)\include;$(HBDIR)\include
.path.C = .\
.path.rc = .\

#important: Use Uppercase for filenames extensions, in the next two rules!

PRG = \
dprog3.PRG \
dssystem.PRG \
dutility.PRG \
dsownprg.PRG \
p_cvdbf.PRG


PROJECT : dprog3.exe

dprog3.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) dprog2.res
echo off
echo $(BCDIR)\lib\c0w32.obj + > b32.bc
echo obj\dprog3.obj obj\dssystem.obj obj\dutility.obj obj\dsownprg.obj obj\p_cvdbf.obj, + >> b32.bc
echo dprog3.exe, + >> b32.bc
echo dprog3.map, + >> b32.bc
echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc
echo $(HBDIR)\lib\hbrtl.lib + >> b32.bc
echo $(HBDIR)\lib\hbvm.lib + >> b32.bc
echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
echo $(HBDIR)\lib\hblang.lib + >> b32.bc
echo $(HBDIR)\lib\hbmacro.lib + >> b32.bc
echo $(HBDIR)\lib\hbrdd.lib + >> b32.bc
echo $(HBDIR)\lib\rddntx.lib + >> b32.bc
echo $(HBDIR)\lib\rddcdx.lib + >> b32.bc
echo $(HBDIR)\lib\rddfpt.lib + >> b32.bc
echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
echo $(HBDIR)\lib\hbdebug.lib + >> b32.bc
echo $(HBDIR)\lib\hbcommon.lib + >> b32.bc
echo $(HBDIR)\lib\hbpp.lib + >> b32.bc
echo $(HBDIR)\lib\hbwin.lib + >> b32.bc
echo $(HBDIR)\lib\hbcpage.lib + >> b32.bc
echo $(HBDIR)\lib\hbct.lib + >> b32.bc

rem Uncomment these two lines to use Advantage RDD
rem echo $(HBDIR)\lib\rddads.lib + >> b32.bc
rem echo $(HBDIR)\lib\Ace32.lib + >> b32.bc

echo $(BCDIR)\lib\cw32.lib + >> b32.bc
echo $(BCDIR)\lib\import32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\psapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\rasapi32.lib, >> b32.bc

IF EXIST dprog3.res echo dprog3.res >> b32.bc
$(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
del b32.bc

.PRG.OBJ:
$(HBDIR)\bin\harbour $< /L /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include
$(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

dprog2.res : dprog2.rc
$(BCDIR)\bin\brc32.exe -r dprog2.rc


It shows error message :
Error dprog2.rc 4 11: Cannot open file:commctl.h


My Dprog2.rc file :

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.50".

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

LANGUAGE LANG_CHINESE,SUBLANG_CHINESE_TRADITIONAL

INIT_PASS 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, 156, 100, 45, 15
CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 156, 116, 45, 15
CONTROL "This is a label:", 4001, "Static", WS_GROUP, 8, 16, 40, 8
CONTROL "This is a label:", 4002, "Static", WS_GROUP, 8, 44, 40, 8
CONTROL "Edit", 4003, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 68, 12, 88, 12
CONTROL "Edit", 4004, "Edit", ES_AUTOHSCROLL|ES_PASSWORD|WS_BORDER|WS_TABSTOP, 68, 44, 88, 12
}


So i delete the line 2 to line 5
#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
and compile again, the another error show :

Error dprog2.rc 9 7:Expecting unsigned long integer



What's wrong? How can i easy to change my old .rc files (16 bit) to .rc files (32bit)? Can anybody help?


FWH 12.01 / bcc582
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Antonio Linares » Mon Apr 16, 2012 7:46 am

Change this:

FONT 8, "Tahoma", 0, 0, 1

into this:

FONT 8, "Tahoma"
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to convert .rc to .res

Postby eddielum » Mon Apr 16, 2012 7:53 am

It shows same error

Error dprog2.rc 9 7: Expecting unsigned long integer
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Richard Chidiak » Mon Apr 16, 2012 7:57 am

put back the 3 lines

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

make sure you add the path for pelles c include files usually C:\Program Files (x86)\PellesC\Include\Win

Hth

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: How to convert .rc to .res

Postby eddielum » Mon Apr 16, 2012 8:31 am

Richard :

I add the path
SET INCLUDE=C:\CLIP53\INCLUDE;C:\FW20\INCLUDE;C:\PROGRA~1\PellesC\Include;C:\PROGRA~1\PellesC\Include\WIN

Error prsht.h 675 1: '#ednif' before '#if'
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Antonio Linares » Mon Apr 16, 2012 8:52 am

Comment these two lines:

// #include <commctrl.h>
// #include <richedit.h>

and it should work :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to convert .rc to .res

Postby Richard Chidiak » Mon Apr 16, 2012 9:12 am

There is a problem in this file , we have all changed it

Download www.cbati.com/prsht.zip

replace the file (prsht.h) in the include directory of pelles c with the one downloaded

PS : i am using pelles c version 5.00

Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: How to convert .rc to .res

Postby eddielum » Mon Apr 16, 2012 9:22 am

Same Error :

Error dprog2.rc 9 7:Expecting unsigned long integer :cry:
I have upgrade new prsht.h

Code: Select all  Expand view
// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.50".

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

LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US

INIT_PASS 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"
{
  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 156, 100, 45, 15
  CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 156, 116, 45, 15
  CONTROL "User Name", 4001, "Static", WS_GROUP, 8, 16, 40, 8
  CONTROL "Password", 4002, "Static", WS_GROUP, 8, 44, 40, 8
  CONTROL "", 4003, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 68, 12, 88, 12
  CONTROL "", 4004, "Edit", ES_AUTOHSCROLL|ES_PASSWORD|WS_BORDER|WS_TABSTOP, 68, 44, 88, 12
}

 


I'm using Pelles C for Windows Version 6.50.8 Release Candidate #4
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Antonio Linares » Mon Apr 16, 2012 4:31 pm

Comment these two lines:

// #include <commctrl.h>
// #include <richedit.h>
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to convert .rc to .res

Postby eddielum » Tue Apr 17, 2012 1:15 am

Hi Antonio,

I change to

// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.50".

#include <windows.h>
//#include <commctrl.h>
//#include <richedit.h>
#include "DPROG2.h"

Error dprog.rc 11 7: Expecting unsigned long integer :cry: :cry:
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Antonio Linares » Tue Apr 17, 2012 6:16 am

Eddie,

What code do you have in line 11 of dprog.rc ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to convert .rc to .res

Postby eddielum » Tue Apr 17, 2012 6:55 am

Code: Select all  Expand view
My .rc file with line number.
1// RESOURCE SCRIPT generated by "Pelles C for Windows, version 6.50".
2
3#include <windows.h>
4//#include <commctrl.h>
5//#include <richedit.h>
6#include "DPROG2.h"
7
8LANGUAGE LANG_ENGLISH,SUBLANG_ENGLISH_US
9
10INIT_PASS DIALOGEX DISCARDABLE 6, 18, 210, 142
11STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
12CAPTION "Dialog"
13FONT 8, "Tahoma"
14{
15  CONTROL "OK", IDOK, "Button", WS_TABSTOP, 156, 100, 45, 15
16  CONTROL "Cancel", IDCANCEL, "Button", WS_TABSTOP, 156, 116, 45, 15
17  CONTROL "User Name", 4001, "Static", WS_GROUP, 8, 16, 40, 8
18  CONTROL "Password", 4002, "Static", WS_GROUP, 8, 44, 40, 8
19  CONTROL "", 4003, "Edit", ES_AUTOHSCROLL|WS_BORDER|WS_TABSTOP, 68, 12, 88, 12
20  CONTROL "", 4004, "Edit", ES_AUTOHSCROLL|ES_PASSWORD|WS_BORDER|WS_TABSTOP, 68, 44, 88, 12
21 }


 


Line 11: "STYLE DS_SHELLFONT|WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|DS_3DLOOK|WS_CAPTION|WS_SYSMENU|WS_VISIBLE"

Is that my PELLES C 6.50 get problem?
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Antonio Linares » Tue Apr 17, 2012 7:25 am

Eddie,

Please change it like this:

STYLE WS_POPUP|DS_MODALFRAME|DS_CONTEXTHELP|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: How to convert .rc to .res

Postby eddielum » Tue Apr 17, 2012 8:11 am

Antonio

I can compile the program now but i still get the problem

Error description: Error FiveWin/3 Cannot create Dialog Box:
Resource: INIT_PASS

Stack Calls
===========
Called from: .\source\classes\DIALOG.PRG => CREATEDLGERROR( 538 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 273 )
Called from: .\dprog3.PRG => GETPASSWORD( 0 )
Called from: .\dprog3.PRG => (b)PAINTSCR( 0 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 973 )
Called from: .\dprog3.PRG => PAINTSCR( 0 )


I think the problem is about the .rc files which create by Pelles C 6.50.8 Release Candidate #4, Is there any other software or other old verison of Pelles C can be replace? I miss Borland Workshop 4.5.
Code: Select all  Expand view


FUNCTION GETPASSWORD()
   LOCAL oUSER, oGET
   LOCAL cPASSWORD :=SPAC(10)
   LOCAL cUSER     :=SPAC(10)
   LOCAL NTRIES    :=0

   DEFINE DIALOG oDLG RESOURCE "INIT_PASS" of oWND1

          REDEFINE GET oUSER VAR cUSER     ID 4003 OF ODLG
          REDEFINE GET oGET  VAR cPASSWORD ID 4004 OF ODLG
          REDEFINE BUTTON ID 5000 OF ODLG ;
                   ACTION NTRIES++,CHKP(cUSER,cPASSWORD,oDLG,@LGO),;
                   IIF(NTRIES>=3,(MsgStop("PASSWORD INCORRECT"),oWND1:End()),)
                   oDLG:SETFOCUS()

          REDEFINE BUTTON ID 5001 OF ODLG ACTION( Msginfo("Cancel"),oWND1:End() )
     

   ACTIVATE DIALOG oDLG;
            CENTERED

   oWND1:END()

RETURN(LGO)

 
FW12.01, BCC582, DBFNTX, Pelles C 6.50
eddielum
 
Posts: 17
Joined: Mon Apr 16, 2012 7:25 am

Re: How to convert .rc to .res

Postby Antonio Linares » Tue Apr 17, 2012 8:28 am

Eddie,

Are you using Windows 32 bits or 64 bits ?

If you are using Windows 7 32 bits then you can keep using Borland Resources workshop :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 108 guests