NotSupportedException on Windows Mobile Device ...

V

Vipul Pathak

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

Christopher Fairbairn

Hi,

Vipul Pathak said:
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
 
V

Vipul Pathak

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

Christopher Fairbairn

Hi,

Vipul Pathak said:
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.

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
Mobile 6 Professional Emulator" and not with "Windows Mobile 6
Professional Device" ? The behavior of device and emulator should match.
Isn't ?

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
 
J

Jan Kuèera

Hello Vipul,
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 think the command Christopher is referring to is "Change Target
Platform..." menu item in the Project menu.

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 ?

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...
 
V

Vipul Pathak

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

ignacio machin

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











- 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.
 
G

gabi dusa

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,
 
P

Paul G. Tobey [eMVP]

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

Paul T.
 
Z

Zack Brown

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



Previous Posts In This Thread:

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.ex
NotSupportedExceptio

a
Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar
a
System.Windows.Forms.Controls._InitInstance(WNT wnt, UInt32 dwStyle
a
System.Windows.Forms.Control..ctr(WNT wnt
a
System.Windows.Forms.Button..ctr(
a
SmartDeviceApplication1.Form1.InitializeComponent(
a
SmartDeviceApplication1.Form1..ctor(
a
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)() ;

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

Pavel B?NSK
Microsoft Czech Republi
http://bansky.net/blo


Vipul Pathak wrote:

Re: NotSupportedException on Windows Mobile Device ...
Hi


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

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




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


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

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...

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




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.

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,

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/tutorial...0-c7354940d878/a-framework-to-animate-wp.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top