Glide Example 1: Error & Fix

ref: [20110913] http://www.ghielectronics.com/glide/example/1/

The resource named “Window” is intended to be a file resource, yet the code indicates a string resource

Might be best to change as follows:

" 1. Add the Window XML.
Create a new .NET Micro Framework project called Test. Next, double-click Resources.resx, click Add Resource and then Add New String. In the prompt, name the new resource “Window” and click Add. Now, copy the XML below and paste it into the Resource.resx Window Value field. Make sure to change the Version=“x.x.x” to the latest version number. (eg. Version=“1.0.0”)

A text file resource is a string. This method is easy to edit by hand. The files can also be changed without VS open. The idea was more than one person could work on windows so you can simply replace the file.

Hi Josh,

The instructions say “Add New Text File” yet XML extraction uses “…GetString(Resources.StringResources.Window)”

In following the steps verbatim, I can not compile to code as the FILE resource ‘Window’ is not of the same type as STRING Resources.StringResources.Window

The only way I could get around this was to make a new STRING resource called ‘Window’ , then it all worked.

Cheers, Ian

I’m not following…

Add New Text File creates a new string resource. The string resource is loaded by Glide via

GlideLoader.LoadWindow(string xmlStr);

Since you named your text file “Window” you call

GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window));

It is not necessary to use Add New String to get it to work.