forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RC compiler in VS2005

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Mon Jan 22, 2007 1:14 pm    Post subject: RC compiler in VS2005 Reply with quote

Hello
I am trying to use FTN+VS2005 + Winteracter
Question : how to define the resource compiler in VS2005
In Plato :
Project => Properties => Miscellaneous [x] SRC compiler options /include c:\wint\include

How to do this in V2005 ?

Klaus
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Jan 22, 2007 6:05 pm    Post subject: Reply with quote

As far as I know there is no equivalent to this in the VS plug-in.

The normal approach would be to copy the resource script into a RESOURCES section immediately after the main program.
See "Resources in FTN95" in the help file.
Back to top
View user's profile Send private message AIM Address
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Mon Jan 22, 2007 9:29 pm    Post subject: Reply with quote

Just to confirm Paul's reply - there is no option in VS for the resource compiler and the way to get it to work is to use a RESOURCES section.
Back to top
View user's profile Send private message
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Fri Jan 26, 2007 11:44 am    Post subject: Reply with quote

Hello
thanks for the answer.
But could you explain a little bit more how to do it ?
I now have a reference file (called reference.rc) which is generated by Winteracter.
What do I have to do with this file using VS2005 to compiler it ?
The example in "Resources in FTN95" help file doe not really help me.

Klaus
Back to top
View user's profile Send private message Visit poster's website
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Sun Jan 28, 2007 3:24 pm    Post subject: Reply with quote

Much like the example provided in the help you would need to include a RESOURCES section after your main program. You should insert the contents of the .rc as produced by Winteracter underneath the RESOURCES statement as the bitmap is done in the example.

Code:

WINAPP
INTEGER i,winio@
i=winio@(‘%ca[A beautiful bitmap]&’)
i=winio@(‘%bm[mybitmap]%2nl%cn%`bt[OK]’)
END
RESOURCES
mybitmap BITMAP c:\bitmaps\pic1.bmp
Back to top
View user's profile Send private message
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Mon Jan 29, 2007 10:53 am    Post subject: Reply with quote

Can I use an include statement instead of copying the resource file into the code ?
Like :

RESOURCES
include 'resource.rc'
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Mon Jan 29, 2007 2:19 pm    Post subject: Reply with quote

In theory YES.
Try it.
Back to top
View user's profile Send private message AIM Address
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Mon Jan 29, 2007 2:53 pm    Post subject: Reply with quote

Well I did try, but does not work.

My program looks like this :
Code:

Program Main
.
.
.
end
RESOURCES
include 'Resource.rc'

Subroutine blabla
.
.
.
end

I get the error : Unsuccessfull compilation of resource script
The line number of error is the last number of the subroutines
Do I need to write something like : End RESOURCE

Klaus
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Jan 30, 2007 8:21 am    Post subject: Reply with quote

You could try moving "RESOURCES" into the "include" file, otherwise it is something that has to be fixed in the FTN95 proprocessor.
Back to top
View user's profile Send private message AIM Address
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Tue Jan 30, 2007 11:13 am    Post subject: Reply with quote

I moved "RESOURCES" into the "include" file.
Here is the a piece of the resource file :
Code:

RESOURCES
///////////////////////////////////////////////////
//
// THIS FILE SHOULD NOT BE EDITED USING A TEXT
// EDITOR OR 3RD PARTY RESOURCE EDITOR, EXCEPT
// WHEN SPECIFICALLY INSTRUCTED BY I.S.S.
//
///////////////////////////////////////////////////
//
// Winteracter resource script.
//
// Modified : 19/Dec/2006 13:08:58
//
///////////////////////////////////////////////////
//
// Include files
//
#include "winparam.h"
#ifdef XLIB
#include "filesel.rc"
#endif
#include "dirsel.rc"
#include "editor.rc"
 
///////////////////////////////////////////////////
//
// Parameter Definitions
//
#define IDD_DIALOG001                     101
#define IDF_RADIO1                       1001
#define IDF_RADIO2                       1002
#define IDF_RADIO3                       1003
#define IDF_GROUP1                       1004
#define IDF_BUTTON_help                  1005
#define IDF_PICTURE1                     1006
#define IDF_STRING1                      1007


Now I get lots of fortran compiler errors.
Like : Invalid character '/' at start of line
It looks like it is trying to compile fortran code and not rescource code.
Any more ideas what to do ?
Klaus
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Tue Jan 30, 2007 1:25 pm    Post subject: Reply with quote

Klaus

"RESOURCES" is only designed to work for a simple subset of resource script commands (i.e. commands one would expect to need with ClearWin+).

For this script you will need to use the SRC compiler directly.
At the moment the FTN95 plug-in for VS does not automatically compile resource scripts for you so you will have to do this from a command line or some kind of batch build within VS.

Once you have created a .obj file from your script (by running SRC) you can import this as a reference in your project.
Back to top
View user's profile Send private message AIM Address
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Tue Feb 13, 2007 4:19 pm    Post subject: Reply with quote

I have a resource.obj file now .
I need to add this file as a reference file to my project ? correct ?
When I go on Add references I can only choose .lib .dll and .exe files.
How can I get the linker to take the resource.obj file ?
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Wed Feb 14, 2007 10:16 am    Post subject: Reply with quote

One way is to put name of the object file in the Project Property Pages dialog under Linker Options->Linker Options->Extra linker options.

Try just giving the name resource.obj but put a copy of the file in each of the places where VS might look for the file (e.g. the Project folder).

My guess is that you will not need anything else but if it does not work take a look at the log file for the build process and compare this with the instructions for using SLINK from a command line.

Another way to get around the problem is to use both VS and Plato. Use VS to edit your resources and Plato to do the build. Each editor will detect changes to the shared files except that Plato (and possibly VS) will not know if the project file (Project.ftn95p) has changed externally so be careful when you change the project properties.
Back to top
View user's profile Send private message AIM Address
MERO



Joined: 25 Apr 2006
Posts: 41
Location: Wuerzburg, Germany

PostPosted: Fri Feb 16, 2007 9:41 am    Post subject: Reply with quote

Way No. one works.
Number two I still have to try
Thanks for the help
Klaus
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group