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)() ;

Re: NotSupportedException on Windows Mobile Device ... by Christopher

Christopher
Thu Mar 13 15:46:34 CDT 2008

Hi,

"Vipul Pathak" <vpathak_NoSpam@boxtoneRemoveThis.com> wrote in message
news:%23gtwFKThIHA.5900@TK2MSFTNGP02.phx.gbl...
> When I run the application, it fails during the execution of method
> "InitializeComponent()". The error is below:
>
> SmartDeviceApplication1.exe
> NotSupportedException
>
> Not that this application works well on the Classic device Emulator.

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



Re: NotSupportedException on Windows Mobile Device ... by Vipul

Vipul
Fri Mar 21 11:31:48 CDT 2008

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@christec.co.nz> wrote in message
news:ej4dOtUhIHA.5900@TK2MSFTNGP02.phx.gbl...
> Hi,
>
> "Vipul Pathak" <vpathak_NoSpam@boxtoneRemoveThis.com> wrote in message
> news:%23gtwFKThIHA.5900@TK2MSFTNGP02.phx.gbl...
>> When I run the application, it fails during the execution of method
>> "InitializeComponent()". The error is below:
>>
>> SmartDeviceApplication1.exe
>> NotSupportedException
>>
>> Not that this application works well on the Classic device Emulator.
>
> 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
>



Re: NotSupportedException on Windows Mobile Device ... by ignacio

ignacio
Fri Mar 21 13:51:47 CDT 2008

On Mar 21, 12:31=A0pm, "Vipul Pathak"
<vpathak_NoS...@boxtoneRemoveThis.com> wrote:
> 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" <christop...@christec.co.nz> wrote in message
>
> news:ej4dOtUhIHA.5900@TK2MSFTNGP02.phx.gbl...
>
>
>
> > Hi,
>
> > "Vipul Pathak" <vpathak_NoS...@boxtoneRemoveThis.com> wrote in message
> >news:%23gtwFKThIHA.5900@TK2MSFTNGP02.phx.gbl...
> >> When I run the application, it fails during the execution of method
> >> "InitializeComponent()". The error is below:
>
> >> SmartDeviceApplication1.exe
> >> NotSupportedException
>
> >> Not that this application works well on the Classic device Emulator.
>
> > 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 suggeste=
d
> > 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 t=
he
> > forms designer to a Windows Mobile Standard platform you should notice
> > that a little exclimation mark is displayed beside the button in the for=
ms
> > 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- Hide quoted text -
>
> - Show quoted text -

Hi,

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