|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
mposhptti
Joined: 01 May 2008 Posts: 7
|
Posted: Fri May 02, 2008 2:00 pm Post subject: .NET VB Calculator Example in VS2005 |
|
|
I've installed the personal edition (ftn95_personal.exe) on an XP system with VS2005 Standard Edition. When I try to use the VB Calculator example by clicking on
...\FTN95Examples\NET\FortranCalculator\VB\VB_Calculator.sln.
VS2005 attempts to convert this, but the conversion doesn't work ("One or more projects failed to convert..."). The FortranCalculatorFrontend is noted in the SolutionExplorer as "unavailable". I've tried adding the vb code manually and have un-installed and re-installed two times to no avail. I have also tried to build the program manually per the help instructions:
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/Silverfrost.FTN95Help/FTN95Help/HTML/NETSAMPLES/FORTRANCALCULATOR.HTM
but (after fixing a couple of name-changes (see *1 below)) the program still will not run. When I compile the "Debug" version I get the error: "Unable to start debugging for target: ...Calculator.dll". When I compile and run the release version, I get the standard Windows error: "...has encountered a problem and needs to close..."
*1 The "ContainingClass" noted in the help file for the VB Calculator example is different from the "ContainngClass" used in the example that was installed with the compiler. The difference is "FTN95Calculator" versus "ftncalc". Also the Assembly_Interface for the PI function was different: "PiValue" versus "PiVal".
On a very basic level, I noticed that the file dates/times in the example folder are significantly different. For example, some dates are:
10/21/2002 12:31 PM 1,028 AssemblyInfo.vb
07/03/2003 03:21 PM 3,566 VB_Calculator.sln
07/03/2003 03:21 PM 4,619 FortranCalculatorFrontend.vbproj
02/22/2008 10:48 AM 1,391 calculator.f95
Lastly, the other examples work (although with some I have to tinker a little after the conversion is made).
So, my question for the forum users is: Has anyone recently:
1. Downloaded and installed the personal edition (ftn95_personal.exe);
2. Double-clicked on the calculator example solution (...\FTN95Examples\NET\FortranCalculator\VB\VB_Calculator.sln);
3. Had VS2005 successfully convert the solution;
4. Built and run the program simply by doing a "Build" - "Build Solution" and "Debug" - "Start Debugging".
If you have done this (without any other steps), then I at least know I have to fix something on my install of FTN95 or VS2005.
Any suggestions?
One other thing, I have successfully built the program by running the batch file buildrel.bat (after I added the necessary paths to vbc and resgen), but this does not create a solution I can load/view/edit in VS2005.
Thank you,
matt |
|
Back to top |
|
|
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
Posted: Sat May 03, 2008 8:11 pm Post subject: |
|
|
There does seem to be a problem with the VB example for Fortran Calculator when using it direct from the examples.
The code differences in the help file are to do with small differences between the C# example and the VB .NET example.
We will have to recreate the example for the next release (this will not be done for the up-coming 5.21), but in the short term - you say the solution builds OK from the batch files - so there is nothing wrong with the code as such. You could recreate the projects from the code contained in the source files if you really need to see this example as you say you have tried. The error you are getting on running the code in debug suggests to me that you have not got the correct project set as the startup project - make sure the frontend is set as the startup project. |
|
Back to top |
|
|
mposhptti
Joined: 01 May 2008 Posts: 7
|
Posted: Mon May 05, 2008 5:30 pm Post subject: Example now works with a couple changes |
|
|
Andrew,
Thank you for confirming that there is a problem with the example. I decided to give the manual approach (building the solution using just the calculator.f95 and fortrancalculatorfrontend.vb) one more shot, so I un-installed and re-installed, and then tried it, making sure to have the VB_Calculator as the "Single startup project". I had to make a couple changes:
1. Per the "Option Explicit" setting, I made the character type literals explicit (e.g., changed add_digit("0") to add_digit("0"c)). I know I could have turned the "Option Explicit" off, but I just made the change so it would work with it on.
2. Commented out the line (from InitializeComponent)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
because it was causing the program to crash during Debugging.
So, it works now and is useful to me as I try to evaluate FTN95. My question now is the following: I am currently evaluating FTN95 versus compilers from Lahey and Intel. There are plusses and minuses I see with each of these. The main ones (for our company) being:
Lahey (+ we have been using Lahey for 10+ years; - no integration with .NET Framework 2.0 or beyond)
Intel (+ stability, robust development and support; - no integration with .NET)
Silverfrost (+ integration with current .NET (3.5)).
The negative with Silverfrost for me is the subject of this post: Why don't all the examples work, and why couldn't someone have sent me an updated calculator example that did work?
Any response you can give will be helpful.
Thank you,
matt |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7929 Location: Salford, UK
|
Posted: Tue May 06, 2008 9:03 am Post subject: |
|
|
Some of the samples were created for ealier versions of Visual Studio and Microsofts solution upgrade process does not always work. This means that separate samples are required for each version of Visual Studio.
The problems lie in the project settings and, with a little effort, it is possible to reinstate the correct starting project and project dependencies etc. These are things that you will have to do when creating your own projects so the learning process is not wasted.
We will do what we can to supply complete and working samples but the bottom line is, if you can get a better deal from a rival compiler then go for it. |
|
Back to top |
|
|
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
Posted: Tue May 06, 2008 9:27 am Post subject: |
|
|
Just to reiterate what Paul Has said really - the example code was based around Visual Studio .NET 2003 (we provide integration for all versions of Visual Studio from 2003 upwards) and it is the Visual Studio upgrade tool that seems to be broken. The example for the VB calculator was broken, and now we have a bug report, a fixed example will be included in the next release. |
|
Back to top |
|
|
|
|
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
|