Is Glide ported to NETFM 4.2?
You should be able to get the sources and recompile against 4.2 with no changes necessary.
I’m having problems compiling glide against 4.2. Could you point me to some kind of tutorial please?
What kind of problems?
roman - i have uploaded a project i have been playing with which uses glide ad netmf4.2 which includes in the bin directory the glide dll which i recomilled for 4.2
I am having simulair problems on my Hydra / display_CP7 .netmf 4.2 project.
I downloaded Glide, using VS2010 Ultimate, where I right-clicked the Glide project in the Solution Explorer. In the Application tab I changed the Target Framework to .NET Micro Framework 4.2. Then I succesfully rebuilt the project. Te GHIElectronics.NETMF.Glide.dll 's are generated and placed in Glide/bin/Release and in the subdirs /Ie and /be.
In my Hydra project I added the Glide/bin/Release/GHIElectronics.NETMF.Glide.dll to the references in the solution explorer. This seem to give a deployment error.
When I also add;
using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
to my project, in Program.cs, Visual Studio is already failing during build.
Does anyone have experience in this? advice? thanks so much, Chris
Try to copy the .dll and the files in the le and de folders to your own project.
Tnx ruimsimao, I copied the files in le and be to my project dir… no difference. I compiled Glide over and over… (Also hitting deploy… ) Added the dll to references in my project. Now Deploy of my project is working so no problem there anymore. Also the files are been copied to the Release and Debug dir’s… Maybe hitting deploy of Glide made the change???
When I add;
using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
to program.cs build reports an error starting with this:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;MF_FRAMEWORK_VERSION_V4_2 /reference:“C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.2\Gadgeteer.dll” /reference:“C:\Program Files (x86)\GHI Electronics\GHI .NET Gadgeteer SDK\Mainboards\FEZHydra\NETMF 4.2\GHIElectronics.Gadgeteer.FEZHydra.dll” /reference:C:\projects\Flier\SRC\App42\App42\bin\Release\GHIElectronics.NETMF.Glide.dll
etc…
So I checked MF_FRAMEWORK_VERSION_V4_2 in my project aswell as in the Glide project (under project properties built tab) where it says Conditional compilation symbols TRACE,MF_FRAMEWORK_VERSION_V4_2
any idear? tnx.
when I only add
using GHIElectronics.NETMF.Glide;
to program.cs the built and deploy is ok. As soon as i also add
using GHIElectronics.NETMF.Glide.Display;
the buid fails
using Microsoft.SPOT.Presentation;
has conflict with Window class, so I removed this include from my app. tnx, all.
I have opened up Glide from in VS10 Express , and set the target framework to 4.2 and the output type to Console Application. When I try to build the program I am getting the following error message :
Error 1 Program ‘C:\Documents and Settings\nzcznr\Desktop\netmfglide-18667\Glide\obj\Debug\GHIElectronics.NETMF.Glide.exe’ does not contain a static ‘Main’ method suitable for an entry point Glide
Is there anything else I need to do to compile?
@ blue123 - It should be a dll not an exe - change output type to library
Yep tried chaning the output type from console application to class library, but when I try to build, a Tinty CLR error pops up saying :
The project must either have an output type of ‘console application’ or ‘class library’, and then another error message pops up saying ‘The operation could not be compiled’.
The build is succeeding when I choose Class Library however, and failing when I choose Console Application.
You have to build the glide source as a Class Library.
Then create a console app and reference the glide dll that you just built
Sorry for being a bit slow but I have built the Glide Project as a Class Library, and now I create a new Console App, what do i run on this console app? When you say reference the dll, do I just add it to my refererences? I already have the GHIelectronics.NETMF.Glide.dll.
@ blue123 - Have a squizz here http://www.ghielectronics.com/glide/example/3/
Right, I can run this example and a couple of others so does this mean the I have compiled glide and that cannot be the issue? My original problem was that while running a few more complex program, it would start to run and then a error message saying ’ An unhandled exception System.Xml.XmlException’ occured in System.Xml.dll’ would come up. I thought the issue would be have something to do with the source code.
The code that I am using is here
using System;
using System.Threading;
using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
using GHIElectronics.NETMF.Glide.UI;
namespace Test
{
public class Program
{
// This will hold the main window.
private static Window window;
// Data Grid
static DataGrid dataGrid;
public static void Main()
{
// Load the window
string xml;
xml = "<Glide Version=\"" + Glide.Version + "\">";
xml += "<Window Name=\"window\" Width=\"320\" Height=\"240\" BackColor=\"dce3e7\">";
xml += "<DataGrid Name=\"dataGrid\" X=\"5\" Y=\"5\" Width=\"310\" Height=\"150\" Alpha=\"255\" Font=\"4\" RowCount=\"5\" RowHeight=\"30\" Draggable=\"True\" TappableCells=\"True\" SortableHeaders=\"True\" ShowHeaders=\"True\" ShowScrollbar=\"True\" ScrollbarWidth=\"5\" HeadersBackColor=\"707476\" HeadersFontColor=\"FFFFFF\" ItemsBackColor=\"FFFFFF\" ItemsAltBackColor=\"F4F4F4\" ItemsFontColor=\"000000\" SelectedItemBackColor=\"FFF299\" SelectedItemFontColor=\"000000\" GridColor=\"BFC5C9\" ScrollbarBackColor=\"C0C0C0\" ScrollbarScrubberColor=\"000000\"/>";
xml += "<TextBlock Name=\"textBlock1\" X=\"5\" Y=\"160\"Width=\"50\" Height=\"32\" Alpha=\"255\" Text=\"Scroll\" TextAlign=\"Right\" TextVerticalAlign=\"Middle\" Font=\"3\" FontColor=\"000000\"/>";
xml += "<TextBlock Name=\"textBlock2\" X=\"5\" Y=\"202\" Width=\"50\" Height=\"32\" Alpha=\"255\" Text=\"Select\" TextAlign=\"Right\" TextVerticalAlign=\"Middle\" Font=\"3\" FontColor=\"000000\"/>";
xml += "<TextBlock Name=\"textBlock3\" X=\"175\" Y=\"160\" Width=\"40\" Height=\"32\" Alpha=\"255\" Text=\"List\" TextAlign=\"Right\" TextVerticalAlign=\"Middle\" Font=\"3\" FontColor=\"000000\"/>";
xml += "<Button Name=\"scrollUpBtn\" X=\"60\" Y=\"160\" Width=\"45\" Height=\"32\" Alpha=\"255\" Text=\"Up\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\">";
xml += "<Button Name=\"scrollDownBtn\" X=\"110\" Y=\"160\" Width=\"60\" Height=\"32\" Alpha=\"255\" Text=\"Down\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "<Button Name=\"selectUpBtn\" X=\"60\" Y=\"202\" Width=\"45\" Height=\"32\" Alpha=\"255\" Text=\"Up\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "<Button Name=\"selectDownBtn\" X=\"110\" Y=\"202\" Width=\"60\" Height=\"32\" Alpha=\"255\" Text=\"Down\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "<Button Name=\"selectClearBtn\" X=\"175\" Y=\"202\" Width=\"50\" Height=\"32\" Alpha=\"255\" Text=\"Clear\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "<Button Name=\"selectDeleteBtn\" X=\"230\" Y=\"202\" Width=\"70\" Height=\"32\" Alpha=\"255\" Text=\"Delete\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "<Button Name=\"clearBtn\" X=\"220\" Y=\"160\" Width=\"50\" Height=\"32\" Alpha=\"255\" Text=\"Clear\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "<Button Name=\"fillBtn\" X=\"275\" Y=\"160\" Width=\"40\" Height=\"32\" Alpha=\"255\" Text=\"Fill\" Font=\"3\" FontColor=\"000000\" DisabledFontColor=\"808080\" TintColor=\"000000\" TintAmount=\"0\"/>";
xml += "</Window>";
xml += "</Glide>";
// Resize any loaded Window to the LCD's size.
Glide.FitToScreen = true;
// Load the Window XML string.
window = GlideLoader.LoadWindow(xml);
// Activate touch
GlideTouch.Initialize();
// Initialize the window.
InitWin();
// Assigning a window to MainWindow flushes it to the screen.
// This also starts event handling on the window.
Glide.MainWindow = window;
Thread.Sleep(-1);
}
static void InitWin()
{
// Setup the dataGrid reference.
dataGrid = (DataGrid)window.GetChildByName("dataGrid");
// Possible configurations...
//dataGrid.ShowHeaders = false;
//dataGrid.SortableHeaders = false;
@ blue123 - If the examples run fine then Glide is all ok. Soooooo that means the tear in the space time continuum is somewhere else…
Ah I see. As I said one or two examples work perfectly from the glide examples folder after I modify them slightly, but the majority seem to cause the warning i mentioned above and the emulator to freeze on ‘loading’, Guess I’ll keep trying.
@ blue123 - post the full code to one that isnt ok and it might be obvious whats wrong…