
Paco
Francisco T. Martinez
iMilDotCalc Available for Sale
MilDotCalc is now available on the Mac App Sto...
Continue readingFarewell
My son's remains were put to rest yesterday in the Dallas/Fort Worth National Cemetery. It was military burial with full honors. Just before we parted to the hollow ground we were given over medal...
Continue readingMil Dot Calculation Software
As many of you know, I have an interest in long range shooting. Here in Texas, there are quite a few shooting ranges that sport...
Continue readingPaco's Blog
Mono and Gtk# development in Windows
If you want to use Visual Studio .NET 2003 to build Gtk# applications that will run without having Mono installed in your system. Use:
http://forge.novell.com/modules/xfmod/project/?gtks-inst4win
If you don't have Visual Studio .NET 2003 but want to code using your favorite editor and perhaps nmake (a Make tool specifically design for Windows). You need to *FIRST* install the Microsoft .NET Framework 1.1 SDK. This is available here (watch out for URL wrapping):
http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en
Then you install the Gtk# Win32 installer for the MS .NET Framework SDK 1.1 available here:
http://forge.novell.com/modules/xfmod/project/?gtks-inst4win
Using the software components described above, you could use csc.exe -- that is the C# compiler supplied by Microsoft -- to build your executable and/or library module assemblies. If it is an executable, you could run it from the command line by just simply specifying the fully qualified path to the resulting exe file.
Since Mono is just awesome, you could take that same executable archive it into a zip file, copy it to a Linux or Mac OS X computer configured to run Mono/Gtk# and run it there using a command line similar to this:
mono ~/bin/MyGuiApp.exe
The Mono runtime will use the Just In Time (JIT) compilation technology and turn it int native code which will give it the best performance during execution. There are times when you are targeting a new type of hardware (like a new CPU) that may not have JIT available yet but may already be supported by mint. In such case you can use a command line like this:
mint ~/bin/MyGuiApp.exe
The Mono interpreter (mint.exe) will be able to interpret the intermediate language (IL) that is enclosed in your file and run it as appropriate in accordance with the local machine's runtime knowledge of the underlying operating system and hardware.
If you just want to be able to run applications you have already compiled in Linux while you are on a Windows machine, you could try the Mono Combined installer. You should be able to build/run your Gtk# application you compiled in Linux -- provided you don't have GNOME dependencies -- in Windows without any other piece of Microsoft supplied software. The latest Mono combined installer is available here:
http://forge.novell.com/modules/xfmod/project/?monowin32
Having the Microsoft .NET Framework and/or SDK installed in your computer prior to the Mono Combined installer or afterward should not matter. The Mono Combined installer does not interact with the Microsoft .NET Framework. It has its own Global Assembly Cache (GAC) and it is not placed on the system PATH during the installation -- This is by design.
A very common scenario has a developer who has developed an application using Mono. THE ACID TEST IS: IF YOU USED MCS.EXE TO COMPILE YOUR PROGRAM PLEASE LISTEN. That developer would then take his/her resulting binary output (e.g. MyApp.exe) and could run it on a Windows computer that had the Mono combined installer by going to the Start Menu of that computer and opening the Mono 1.0.1 Command Prompt. This will spawn a console session that is at that point configured correctly with a Mono runtime environment. Just as you would on a Linux shell (Bash or Tcsh) you could then run you application by type a command line similar to this:
C:\>mono d:\PacoBin\MyApp.exe
It turns out that I had written about this before. This may just abound and complement my previous entry.
Thank you Lluis and kangaroo.
Comments: Mono and Gtk# development in Windows
We've built some GUI apps using Microsoft Studio which have issues when run under Mono.
When loading image streams from resources in an assembly using the ResourceManager we've found the Mono CLR cannot perform the type conversions which are supported by the Microsoft CLR.
The microsoft tools output the following code:
this.largeImageList.ImageStream = (System.Windows.Forms.ImageListStreamer)(resources.GetObject("largeImageList.ImageStream")));
GetObject returns a System.String containing the base64 imagestream data.
The type conversion to an ImageListStreamer type generates an exception "Cannot cast from source type to destination type."
Any help you can give would be appreciated.
Thanks.
Actually, the gtk# installer seems to check for Visul C#. It wouldn't install even though I had the 1.1 SDK installed.
The installer at:
http://forge.novell.com/modules/xfmod/project/?monowin32
seems corrupted?
I downloaded several times by both ftp and http and even onto different machines and the md5sum never matched the one supplied.
Is this a known problem?