From: Zack on

In my case I had to Invoke to the UI thread to avoid the problem. I managed to get hold of an inner exception and the stack, which eventually led me to the conclusion it was the UI main thread of .NET framework that complained ... my update also came from another thread so I should have used it all along from the start.

R/Z



Vipul Pathak wrote:

Thanks Christopher,The problem is resolved.
21-Mar-08

Thanks Christopher,

The problem is resolved. I was mistakenly using Windows Mobile 6
Professional, that didn't restricted me to use buttons. When I switched to
Windows Mobile 6 Standard, I can see that buttons are not allowed.

Thanks,

*(Vipul)() ;



"Christopher Fairbairn" <christopher(a)christec.co.nz> wrote in message
news:ej4dOtUhIHA.5900(a)TK2MSFTNGP02.phx.gbl...

Previous Posts In This Thread:

On Thursday, March 13, 2008 1:48 PM
Vipul Pathak wrote:

NotSupportedException on Windows Mobile Device ...
Hi Everyone,

I am writing a simple application to start with Windows Mobile 6. Though, I
have developed many applications on .NET Framework 1.1, but this is the
first time I am working on Compact Framework.

I have tried to write an application, that creates a simple form with 2
buttons on that, "Hide" and "Unload". I built the application well and
copied it to the device. The application was build using FW 3.5 and before
running the application on the device, I installed .NET CF 3.5
(NETCFv35.wm.armv4i.cab) on the device and rebooted it.

When I run the application, it fails during the execution of method
"InitializeComponent()". The error is below:

SmartDeviceApplication1.exe
NotSupportedException

at
Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
at
System.Windows.Forms.Controls._InitInstance(WNT wnt, UInt32 dwStyle)
at
System.Windows.Forms.Control..ctr(WNT wnt)
at
System.Windows.Forms.Button..ctr()
at
SmartDeviceApplication1.Form1.InitializeComponent()
at
SmartDeviceApplication1.Form1..ctor()
at
SmartDeviceApplication1.Form1.Program.Main()


I have only set the text property of the buttons, no tricky code, no
functionality ...

I am not clear what is not supported, The button control or the Framework ?
OR is it a symptom of some other problem.

Not that this application works well on the Classic device Emulator.

Can some one knows about it ?

Thanks,

*(Vipul)() ;

On Thursday, March 13, 2008 2:05 PM
Pavel Bansky (MSFT) wrote:

Hi, this is wrong group.
Hi, this is wrong group.
You shold post this to Compact Framework Group


Pavel B?NSK?
Microsoft Czech Republic
http://bansky.net/blog



Vipul Pathak wrote:

On Thursday, March 13, 2008 4:46 PM
Christopher Fairbairn wrote:

Re: NotSupportedException on Windows Mobile Device ...
Hi,

"Vipul Pathak" <vpathak_NoSpam(a)boxtoneRemoveThis.com> wrote in message
news:%23gtwFKThIHA.5900(a)TK2MSFTNGP02.phx.gbl...

It wouldn't be the Windows Mobile Standard emulator or device (i.e.
smartphone) that is causing this exception?

Buttons are not supported on the smartphone user interface (the suggested
replacement is soft key menu items), this will lead to the
NotSupportedException you mention whenever a button is attempted to be
created. Buttons are only supported on the Windows Mobile Classic or
Professional (i.e. pocketpc) platforms.

If you use the "Change Platform" option within Visual Studio to switch the
forms designer to a Windows Mobile Standard platform you should notice that
a little exclimation mark is displayed beside the button in the forms
designer indicating it is not supported. You will also notice that the
controls in the toolbox changes to remove those not available on this
platform (there are a couple of others as well).

Hope this helps,
Christopher Fairbairn

On Thursday, March 13, 2008 7:15 PM
Vipul Pathak wrote:

Hey Christopher,Thanks for the reply, however I didn't found any such option
Hey Christopher,

Thanks for the reply, however I didn't found any such option of "changing
platform" with form designer in MS Visual Studion 2008. Although, My app. is
now working after removing the Buttons and using the menu items. Thanks.

I have a question though, Why the application was working with "Windows
Mobile 6 Professional Emulator" and not with "Windows Mobile 6 Professional
Device" ? The behavior of device and emulator should match. Isn't ?

Thanks,

*(Vipul)() ;



"Christopher Fairbairn" <christopher(a)christec.co.nz> wrote in message
news:ej4dOtUhIHA.5900(a)TK2MSFTNGP02.phx.gbl...

On Thursday, March 13, 2008 7:33 PM
Christopher Fairbairn wrote:

Re: NotSupportedException on Windows Mobile Device ...
Hi,

"Vipul Pathak" <vpathak_NoSpam(a)boxtoneRemoveThis.com> wrote in message
news:ew0zzAWhIHA.200(a)TK2MSFTNGP02.phx.gbl...

You should be able to find this option within the Project menu of Visual
Studio. Near the bottom of the menu there should be a "Change Target
Platform..." option that brings up a small dialog that allows you to select
between the various platforms you have SDKs installed for.

You can also get this menu option by right clicking on your Smart Device
project within Solution Explorer.

> I have a question though, Why the application was working with "Windows

Yes that does sound very strange. I suspect that there may have been
something else at play in that situation. I have found the modern emulators
to match the behaviour of an actual device very closely and buttons are
definatly supported by Windows Mobile 6 Professional devices.

Hope this helps,
Christopher Fairbairn

On Thursday, March 13, 2008 9:49 PM
milous wrote:

Hello Vipul,I think the command Christopher is referring to is "Change Target
Hello Vipul,


I think the command Christopher is referring to is "Change Target
Platform..." menu item in the Project menu.



Are you sure you have touch screen on the device? What actual device do you
have?

Jan


PS. But I agree with Pavel that we should not try to answer non Micro
Framework questions here...

On Friday, March 21, 2008 12:31 PM
Vipul Pathak wrote:

Thanks Christopher,The problem is resolved.
Thanks Christopher,

The problem is resolved. I was mistakenly using Windows Mobile 6
Professional, that didn't restricted me to use buttons. When I switched to
Windows Mobile 6 Standard, I can see that buttons are not allowed.

Thanks,

*(Vipul)() ;



"Christopher Fairbairn" <christopher(a)christec.co.nz> wrote in message
news:ej4dOtUhIHA.5900(a)TK2MSFTNGP02.phx.gbl...

On Saturday, March 22, 2008 11:09 PM
ignacio machin wrote:

Re: NotSupportedException on Windows Mobile Device ...
d
he
ms

Hi,

FYI, there is a goup .dotnet.compactframework that is dedicated to
smart devices development, you will find there more helpful answers.

On Tuesday, November 11, 2008 7:55 AM
gabi dusa wrote:

NotSupportedException on Windows Mobile Device ...
Hi,

I had the same problem.
It appeared because I deployed the project on a Windows Mobile 6 Smartphone, not PocketPC.
So, I think you have a platform related problem. From what I know Smartphones do not accept creatin buttons.

Regards,

On Tuesday, November 11, 2008 10:01 AM
Paul G. Tobey [eMVP] wrote:

The same problem as what?
The same problem as what? Reply to the thread that you are talking about.
This message is useless to us. We have no idea what you are talking about.
This is not a chat room...

Paul T.


Submitted via EggHeadCafe - Software Developer Portal of Choice
A Framework to Animate WPF and Silverlight Pages Similar to the PowerPoint Slides
http://www.eggheadcafe.com/tutorials/aspnet/7390a840-dd39-4c35-9940-c7354940d878/a-framework-to-animate-wp.aspx