CP7 Display & General Glide Question

I keep running into this error:

“Error 1 Cannot implicitly convert type ‘GHIElectronics.NETMF.Glide.Display.Window’ to ‘Microsoft.SPOT.Presentation.Window’”

with lines of code like this:

windows[0] = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.splshscreen)); 

I keep reinventing the wheel when this problem comes up but never remember how I solved it later. I think, in the past, I’ve had a blue underline to click on Resources to differentiate between the SPOT reference and the Glide reference but I don’t have this option currently. How do I point “Resources” in this line to Glide.

As a side note, is there a reason that different verbiage wasn’t used given the obvious conflict? This has cost me plenty of time.

You need to include the full namespace.

Microsoft.SPOT.Presentation.Resources (? not sure about this one off the top of my head)

I believe Microsoft.SPOT.Presentation.Window is for WPF?

Thanks Ian, I had tried that before and had an error. I tried again to recreate the error.

“The type or namespace name ‘Resources’ does not exist in the namespace ‘GHIElectronics.NETMF.Glide’ (are you missing an assembly reference?)”

I have removed and added the GHIElectronics.NETMF.Glide.dll, using the same reference file from a project that is working, yet the error persists.

Any ideas?

After re-reading your original error I realized I may have got off track with your comments about the resources. What is your windows[] defined as? Sounds like it’s a Microsoft.SPOT.Presentation.Window instead of a Glide window as Mike hinted.

That was the issue. The Window was being reference to SPOT instead of Glide. It seems weird that in some projects I don’t have to type the reference path for Glide, it gives me the option to bind because it is “ambiguous” in other projects it seems to default to SPOT. Perhaps I added the project reference for the Glide .dll file after I typed my code. Does seem like a reasonable assumption as to what is causing this inconsistency?

It’s all related to your “using” statements. The namespaces higher on the list gets priority. If you use both namespaces and don’t want to type the full namespace every time then add a

using Window = GHIElectronics.NETMF.Glide.Window;