link between PRG and RC

link between PRG and RC

Postby Ruth » Mon Jan 29, 2024 4:34 pm

dear all,

I would greatly appreciate if someone could help a fw-beginner like me out.

Here's the structure of my project:

Main folder containing:
configs folder
rc folder
release folder
source folder
*.prj file

my first question: is this a conventional way of organizing a fivewin project?

my second question: i noticed that prg files seem to interact with files located in rc/*.rc. but I am unable to find an explicit link in the prg file that would confirm to me this connection.

please would someone be so kind as to explain the syntax used for this purpose to me.
I suspect that RESOURCE "..." has something to do with it...maybe... does the compiler automatically take the *.rc file into consideration if it has the same name as the *.prg

thank you very much in advance and kind regards
ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: link between PRG and RC

Postby karinha » Mon Jan 29, 2024 8:18 pm

Good afternoon Ruth, sorry for the question, can you tell me what your level of knowledge of FiveWin The Best is?

Buenas tardes Ruth, perdón por la pregunta, ¿puedes decirme cuál es tu nivel de conocimiento de FiveWin The Best?

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: link between PRG and RC

Postby Ruth » Mon Jan 29, 2024 8:43 pm

Thank you for your answer :-)
my level in fivewin is beginner...
i am used to working with html, javascript, bootstrap and also modharbour and would like to learn and understand fivewin and everything that comes with it better.
thanks again and kind regards
ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: link between PRG and RC

Postby Antonio Linares » Mon Jan 29, 2024 9:42 pm

Dear Ruth,

FiveWin provides a high level of freedom to developers so it is quite usual to find FiveWin developers organizing their work in different ways.

As a general rule, the better you organize and structure your project, the easier it will be to mantain it. This can be easily achieved using child folders from a parent folder.

This is a good structure to use:
Folder MyApp
+ Folder source
+ Folder include
+ Folder lib (if you are using third party libs)
+ Folder obj (to place the resulting C and OBJs)
+ Folder resources
... + rc file (one or more)
... + bitmaps
... + icons
... + cursors
go.bat (a batch file to run the project building)
MyApp.hbp (hbmk2 Harbour project file)


Hope this helps you. If you have any doubts, please feel free to ask :-)
regards, saludos

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

Re: link between PRG and RC

Postby carlos vargas » Tue Jan 30, 2024 1:28 am

Image
Image
i use xmate or hbmk2 in harbour. :-)
for the msvc version of my app i use xmate.
for example, this is the .hbp project HBMK2 for fwh+mingw+harbour

-hbexe
-oprestamos32g
-workdir=obj\
-compr
-info
-inc
-trace
-static
-fullstatic
-strip
-jobs=%NUMBER_OF_PROCESSORS%
-beep
-run

#-cflag=-DNTDDI_VERSION=NTDDI_WIN7 -D_WIN32_WINNT=_WIN32_WINNT_WIN7
-ldflag+=-Wl,--allow-multiple-definition
-prgflag=/n /gc2 /w0 /es2 /v /q0 /kmo /d__DEV__;__EDITAR_REPORTE2__
-resflag=-D__FLAT__

#-nodefgt
-gtgui

-id:\fwh\include
-id:\fwh\include2
-iinclude

-Ld:\fwh\lib

-lpatch
-lfiveh
-lfivehc
-llibmysql
-lhbtmysql

-lgdiplus -lversion
-lodbc32 -lsetupapi -lpsapi
-lopengl32 -loledlg -lmfcuia32 -lwin32k -lvfw32 -lstdc++ -lwsock32 -lurlmon

source\prestamos.prg
source\prestamos_acercade.prg
source\prestamos_conectar.prg
source\prestamos_acceso.prg
source\prestamos_menu.prg
source\prestamos_contadores.prg
source\prestamos_feriados.prg
source\prestamos_rutas.prg
source\prestamos_usuarios.prg
source\prestamos_clientes.prg
source\prestamos_cobradores.prg
source\prestamos_cat.prg
source\prestamos_nuevo.prg
source\prestamos_pagos.prg
source\prestamos_ajustes.prg
source\prestamos_ver.prg
source\prestamos_mora.prg
source\prestamos_cobranza.prg
source\prestamos_cierrecobro.prg
source\prestamos_respaldo.prg
source\prestamos_reportes.prg

source\fun_extenciones.prg
source\fun_msgget.prg
source\fun_showerror.prg
source\fun_visor.prg
source\fun_varias.prg

source\fwsrc\tmytitle.prg
source\fwsrc\rpreview.prg
source\fwsrc\msgrun.prg
source\fwsrc\msglist.prg

resource\prestamos.rc

#hbxpp.hbc
xhb.hbc
hbwin.hbc
hbct.hbc
hbmzip.hbc
hbziparc.hbc
#hbfoxpro.hbc
hbmisc.hbc

c.bat
@echo off
set olpath=%path%
set path=%path%;d:\compiler\mingw\bin;d:\compiler\harbour\bin
hbmk2 prestamos32.hbp
set path=%olpath%
pause
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1721
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: link between PRG and RC

Postby Ruth » Tue Jan 30, 2024 6:01 am

good morning :-)
this helps me very much. thank you :-)
please can you help me once more here ...
in my code in the *.prg i see
Code: Select all  Expand view  RUN

    DEFINE DIALOG oDlg ;
        RESOURCE "NACHFASSEN" ;
           TITLE Setup():PrgPath + "CRM-Mail in 4 Schritten" ;
           BRUSH Setup():oBrushBlau ;
            FONT Setup():oFntMedium ;
            ICON oIco ;
     TRANSPARENT

and i assume this is the code for my modal-window to pop up.
where/how does the *.prg get told to look for more also in the *.rc?
I experience that it probably does because this gets processed
Code: Select all  Expand view  RUN

NACHFASSEN DIALOG DISCARDABLE 17, 36, 703, 348
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_SYSMENU|WS_VISIBLE
CAPTION "Betreuungsemail in 4 Schritten"
FONT 10, "Segoe UI"
{
  CONTROL "1. Abfrage ausw�hlen   ", 30, "Button", BS_GROUPBOX, 8, 4, 384, 124
  CONTROL "", 101, "TXBrowse", WS_TABSTOP|0x00300000, 4, 164, 444, 174
  CONTROL "heute", 4001, "Static", WS_GROUP, 36, 44, 100, 8
  CONTROL "", 4002, "ComboBox", WS_BORDER|CBS_DROPDOWN|CBS_SORT|WS_VSCROLL|WS_TABSTOP, 36, 20, 288, 40
  CONTROL "   2. Anreise in:", 4003, "Static", WS_GROUP, 36, 76, 56, 8
  CONTROL "", 4004, "ComboBox", WS_BORDER|CBS_DROPDOWN|CBS_SORT|WS_VSCROLL|WS_TABSTOP, 124, 76, 24, 40
  CONTROL "Tagen", 4005, "Static", WS_GROUP, 152, 80, 24, 8
  CONTROL "3. Abfrage starten", 4006, "Button", WS_TABSTOP, 204, 76, 108, 12
  CONTROL " 4. Email abschicken", 4007, "Button", WS_TABSTOP, 540, 144, 108, 12
  CONTROL "Treffer gesammelt nach Emailvorlagen", 4008, "Static", WS_GROUP, 432, 8, 144, 8
  CONTROL "", 4009, "TXBrowse", WS_TABSTOP|0x00300000, 432, 20, 176, 104
  CONTROL "Empf�ngerliste", 4010, "Static", WS_GROUP, 8, 152, 56, 8
  CONTROL "Beenden", IDCANCEL, "Button", WS_TABSTOP, 540, 320, 108, 12
  CONTROL "This is a label:", 4011, "Static", WS_GROUP, 32, 100, 104, 8
  CONTROL "Anreisen insgesamt: davon mit dem ausgew�hlten Kennzeichen", 4012, "Static", WS_GROUP, 8, 140, 300, 8
  CONTROL "2. Tage ausw�hlen", 4013, "Static", WS_GROUP, 16, 60, 164, 8
  CONTROL "", 4014, "ComboBox", WS_BORDER|CBS_DROPDOWN|CBS_SORT|WS_VSCROLL|WS_TABSTOP, 204, 40, 180, 40
}
 


but i don´t see something written in the *.prg code ... how are the prg and the rc linked? or is it enough for them to sit in the same project.

again THANK YOU for your patience and kindness
ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: link between PRG and RC

Postby Antonio Linares » Tue Jan 30, 2024 6:24 am

Dear Ruth,

good morning

In your code:

DEFINE DIALOG oDlg RESOURCE "NACHFASSEN" ... // Notice that you are using "NACHFASSEN"

and in the resource file, here you have the same name:

NACHFASSEN DIALOG DISCARDABLE ... // NACHFASSEN is here again

Next is to REDEFINE the controls from the RC file that you want to manage from your PRG. You may find several REDEFINE commands in your PRG code

Hope this helps. Please feel free to ask any doubt about it :-)
regards, saludos

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

Re: link between PRG and RC

Postby Ruth » Tue Jan 30, 2024 7:03 am

dear antonio,
thank you very much. i also see the REDEFINE. Great :-)
so i understand it is enough to have
Code: Select all  Expand view  RUN
DEFINE DIALOG oDlg ;
        RESOURCE "NACHFASSEN" ;

I don´t have to tell the *.prg where to go looking - a hint to *.rc?
like in css where you first link the file before you can use its styling opportunities?

i am looking forward to starting ... i will "just" change the font first.
it says FONT 10, "Segoe UI"
please, where can i find all the usable fonts for my project? do i have to install them?
if i then distributed the exe to another computer how could i make sure he has the font available too?

thank you very much, dear antonio and dear fivewinners.
have a nice day
ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: link between PRG and RC

Postby Antonio Linares » Tue Jan 30, 2024 7:46 am

Dear Ruth,

> I don´t have to tell the *.prg where to go looking - a hint to *.rc?

It is not needed as FiveWin automatically look for it inside the EXE

> it says FONT 10, "Segoe UI"

Simply change "Segoe UI" into othe font name as "Verdana", "Arial", etc.

> please, where can i find all the usable fonts for my project? do i have to install them?

Here you have a small FWH (FiveWin for Harbour) example to see all the fonts that you have available:
Code: Select all  Expand view  RUN
#include "FiveWin.ch"

function Main()

    XBrowser( ChooseFont() )

return nil

> if i then distributed the exe to another computer how could i make sure he has the font available too?

Good question. Let me think about it...
regards, saludos

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

Re: link between PRG and RC

Postby Enrico Maria Giordano » Tue Jan 30, 2024 9:05 am

Antonio Linares wrote:NACHFASSEN DIALOG DISCARDABLE ...


From MS docs:

DISCARDABLE Ignored. In 16-bit Windows, the resource can be discarded if no longer needed.
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: link between PRG and RC

Postby Ruth » Tue Jan 30, 2024 9:33 am

thank you very much ...
so i just write
Code: Select all  Expand view  RUN
NACHFASSEN DIALOG

and make everything slimmer -> less words for less memory usage... :D
just kidding ... but less words for cleanliness and readability is very useful for me...
learning a new language is exciting and also challenging...
thank you very much again and kind regards
ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: link between PRG and RC

Postby Enrico Maria Giordano » Tue Jan 30, 2024 9:48 am

Ruth wrote:but less words for cleanliness and readability is very useful for me...


I agree!
User avatar
Enrico Maria Giordano
 
Posts: 8725
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: link between PRG and RC

Postby Antonio Linares » Tue Jan 30, 2024 11:10 am

Dear Ruth,

We have implemented a new FWH function FW_CheckFont( cFontName ) --> lFound

This is an example of use:
Code: Select all  Expand view  RUN
#include "FiveWin.ch"

function Main()

   local cFontName := "MyFontName"

   if ! FW_CheckFont( cFontName )
      MsgAlert( "Font not found: " + cFontName )
   endif    

return nil

You need updated FWH libs. Please let me know if you use Borland or Microsoft Visual Studio, and I will email them to you :-)
regards, saludos

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

Re: link between PRG and RC

Postby Ruth » Tue Jan 30, 2024 1:59 pm

Dear Antonio,

this is wonderful. I am really looking forward to using FW_CheckFont( cFontName ) :-) Thank you very much :-)

Please let me know if you use Borland or Microsoft Visual Studio


regarding the development tools, i use VISUAL STUDIO CODE for almost everything i do so far ... since i have not yet compiled anything i am really looking forward to it.

and also we use UESTUDIO in our company ... i hope this was your question and i thank you for your patience :-)

i was so eager to start so i just copied all the folders that seemed necessary to me from my sister´s computer.
now i have for example
- FWH folder
- HB30 folder
and some more
and i also installed xmate and googled hbmk2 as mr. vargas kindly mentioned...now i am trying to connect the dots :-)

maybe there is a installation guide somewhere? i would highly appreciate someone telling me all the ingredients i need for making a program with fivewin - a list of necessary tools and resources? i see the source code and begin to understand slowly and gradually but compiling is still a mystery to me. i suppose there is a button that does it for me if i set up everything correctly?

any guidance would be very appreciated.
kind regards and thanks again
ruth
User avatar
Ruth
 
Posts: 172
Joined: Fri Dec 07, 2007 1:26 pm

Re: link between PRG and RC

Postby Antonio Linares » Tue Jan 30, 2024 2:14 pm

Dear Ruth,

I meant what C compiler do you plan to use with Harbour: Borland C or Microsoft C ?

My advise is to use Microsoft C for both 32 & 64 bits apps. You can freely download it from here:
https://visualstudio.microsoft.com/

When you install it, please select this option:
https://github.com/FiveTechSoft/screenshots/blob/master/visual_studio_options.png?raw=true

Image
regards, saludos

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 71 guests