Silverfrost Forums

Welcome to our forums

Experimenting with .NET and FTN95

8 Nov 2012 7:34 #10994

Hi all,

I have been experimenting with FTN95 and .NET inter-operability recently. I use Component Pascal to write my .NET code and it works quite nicely.

I converted this mandelbrot example into Component Pascal.

Available here, if someone is interested.

8 Nov 2012 11:57 #10998

Great documentation, BTW!

Got 'Unhandled exception' executing your EXE file, guessing why. Can somebody download and run it too?

9 Nov 2012 8:06 #11000

Quoted from DanRRight

Got 'Unhandled exception' executing your EXE file, guessing why. Can somebody download and run it too?

Strange, it runs fine on my computer. Can you give any more info about the exception?

14 Nov 2012 4:36 #11041

Copying the text from error report:

'See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text ************** System.TypeInitializationException: The type initializer for 'MandelbrotBackend' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Salford.Fortran.RTLibrary' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at Salford.Fortran.RTLibrary.__com_plus_initialise(Int32 hin) at Salford.Fortran.RTLibrary.InitLibrary() --- End of inner exception stack trace --- at Salford.Fortran.RTLibrary.InitLibrary() at MandelbrotBackend..cctor() --- End of inner exception stack trace --- at MandelbrotBackend.SetupMandelbrot(Bitmap , PictureBox ) at Mandelbrot.Mandelbrot.SetupMandelbrot() at Mandelbrot.Form1.ActionOnLoad(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

Mandelbrot Assembly Version: 0.0.0.0 Win32 Version: CodeBase: file:///C:/_Work/2012/Silverfrost/Jalih/mandelbrot/bin/Mandelbrot.exe

RTS Assembly Version: 0.0.0.0 Win32 Version: 0.0.0.0 CodeBase: file:///C:/_Work/2012/Silverfrost/Jalih/mandelbrot/bin/RTS.DLL

System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5460 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5456 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5462 (Win7SP1GDR.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

MandelbrotBackend Assembly Version: 1.0.0.0 Win32 Version: CodeBase: file:///C:/_Work/2012/Silverfrost/Jalih/mandelbrot/bin/MandelbrotBackend.DLL

ftn95lib Assembly Version: 1.1.0.0 Win32 Version: 1.1.0.0 CodeBase: file:///C:/Windows/assembly/GAC/ftn95lib/1.1.0.0__626494245e82c014/ftn95lib.dll

************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

<configuration> <system.windows.forms jitDebugging='true' /> </configuration>

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger regis'

14 Nov 2012 6:15 #11042

I think it's 64-bit vs. 32-bit .NET issue. Try setting the program binary to 32-bit mode using the corflags utility:

corflags.exe /32BIT+ Mandelbrot.exe
Please login to reply.