Visual Studio questions - General Questions and Answers

1. How can i make WVGA application in visual studio? Largest screen option i can create is VGA (Windows Mobile 6 Professional VGA) and then there is blank area on bottom of application.
2. How can i make separate form for landscape/portait (so i can reorder elements when phone is in landscape)?
3. Is there any better emulator? Included one is slow and i cant set up anything that need soft reset (when i do soft reset, visual studio launch new emulator window, because old one "disconnected")
4. Is there any way to remove unsigned warning, when you test directly on PDA? Its annoying that i must confirm every time i want to test something.

Visual Studio Answers
1. Download the Windows Mobile 6.1.4 SDK it has a 400x800 device. Or download 6.5 for a device labeled WQVGA. The 6.5 Emulator is even slower than 6.1.
2. Don't bother with two forms, in the OnPaint (MFC..NET) or WM_PAINT (Win32) code read the size of the Client Area of the screen (GetClientRect() or Form.ClientSize) , then decide whether it is Landscape or Portrait and position the stuff on the screen exactly where you want it.
3. You are stuck with the stuff that MS releases, unless the phone manufacturers decide to release their own images. (Unlikely.)
4. If your EXE is unsigned the OS will turn its nose up at it, the first time it is run and ask you if you want to execute it. If it is recompiled the phone thinks it is a different program, and asks you again. Sign the image to stop it.

works just fine for me
in emulator options you can set the res to what you want
and in the size of your form you can set the size to what you want
if you're not up for altering the res yourself then you can dl the se x1 sdk it comes with a ready
wvga emulator

For # 1, you can download the complete developers toolkit here.
For # 2, if you mean how to change the emulator to landscape... go to File -> Configure -> display on the emulator and select the required angle in the Orientation field. Then you need to manually set the screen to landscape inside the emulator (Windows Mobile) by going to START->SETTINGS->SYSTEM->SCREEN and selecting LANDSCAPE. The emulator should change this automatically depending on the screen orientation, but it doesn't (?).

Don't bother with two forms, in the OnPaint (MFC..NET) or WM_PAINT (Win32) code read the size of the Client Area of the screen (GetClientRect() or Form.ClientSize) , then decide whether it is Landscape or Portrait and position the stuff on the screen exactly where you want it.
Click to expand...
Click to collapse
Can you please explain how to work with that?

it's only relevant if you do c++ without .net

Sorry about that, I was rushed, and it was a bit vague.
In Win32 your application is sent a WM_PAINT message when the window requires redrawing. In this case trap the message and then use GetClientRect() to obtain the dimensions of the client area. Depending on whether the screen is wider than taller, or vice versa, it will tell you the orientation of the screen.
In MFC or .NET the OnPaint event of the form is triggered. Add code in this event to examine the form's ClientSize property to find the same details. This is a Size object which has Height and Width sub values. i.e the width is Form.ClientSize.Width and the height is Form.ClientSize.Height. By comparing these values you can figure out the orientation.
This event occurs before the individual elements of the screen are drawn, so you can change their Left and Top properties to move them around to where you require them on the form.

I downloaded WinMobile 6.5 Development kit, but there was not WVGA option under FormFactor, only new emulators appeared. I solved problem with manually increasing form height.
Anyway, thanks for all information!

Related

Win Core 5.0 display area

Hi, please tell me if there is a way to make the message boxes and windows (of course some of them are outside the screen area) to force to display in screen area, not to have a part of window outside screen.
The display driver is ddi.dll.
Thanks for your help.
Unless its your windows (from your own app) no.
ddi.dll is the generic name for WM / CE display driver so it tells us nothing of the device.
If you describe your problem in more details, like the exact device, the apps that do not display properly etc. perhaps someone will be able to help.
Ok, the device is a pna running win core 5.0. Apps. that are outside are using gdi (apps which use gx are displayed normally thanks to gapi 4.0), but the others designed for 230x320 are outside (the device has display 320x240).
Ok, I think I understand what you are trying to do - you "opened" a PND and are trying to run PPC apps on it right?
Unfortunately, currently there is no way to help apps that can not adjust to screen resolution by themselves.
PNDs are intentionally limited in features and screen rotation option was removed from the driver.
Unless a program was written to take in to account the screen size (many PPC programs were not) there is no way to force it to the right resolution.
And even if it could be done (there is a theoretical way) it will always be buggy and unstable.

Rotating an image, windows mobile, vb.net

So I have been messing around with windows mobile development (in vb, don't hate me, i have grown accustomed to vb because of work). Anyways I come to a point where i would like to use the graphics object to draw an image and rotate it on occasion based on the state of the program. My instincts told me to use System.Drawing.Drawing2D.Matrix object to create that rotation but as it turns out it appears .net compact framework doesn't support that object.
So my question then is, is there any other method for rotating an image as i draw it. I can program in other languages as well if that is what is required, I was really only using vb because it was easy.
Any ideas?
Thanks
don't know about vb but
in c# i would look for an event to subscribe to
which would be fired when the orientation changed
or the resolution changed or some control resized
Sorry the question isn't related to orientation or resolution. I know when I want to rotate the image.
I will give more information, the image is a compass and I want to rotate the compass image based on GPS data received (Calculating the angles is not the problem either). Once I know that say I am 10 degrees off of north, i want to rotate the image of the compass so that north is still pointing north.
In my desktop development this would be done in vb or c# using the System.Drawing.Drawing2D.Matrix class, using Matrix.Rotate and them applying that matrix to the graphics object before i draw the image using graphics.drawImage().
Now the problem comes when I move to the mobile platform where System.Drawing.Drawing2D.Matrix does not exist and is appariently unimplemented. So then my question is, are there any other API's on the Windows Mobile Platform that support Rotation of an image by an arbitrary angle, and if not does any one have any good ideas where to start looking for implementing the rotation manually myself.
Thanks in advance
That's one of the annoyances with the .NET compact framework, not all of the PC .NET framework is implemented, and sometimes it's the bit you really want.
Time for a different angle on the problem. Create 36 compass images 10 degrees apart and store them all in an ImageList object. Pull the one you require out of it when the heading changes. Not quite as elegant as the Matrix class, but it may have to do.
The other approach would be to use DirectX drawing. The coding to do it, would probably involve a very steep learning curve, but not having dabbled in this arena yet, I can't offer much help.
The ImageList object in the .NET compact framework does not support ImageList.Draw(), (darn!, see previous post), so you would have to create a PictureBox object or similar and use :-
PictureBox1.Image = ImageList1.Images;
Where i is the index of the image you want to use. (0 to 35)
Thanks for the suggestions, I did end up predrawing the images of the compass. At the moment I went ahead and made 360 images but I am surely going to cut that down quite a bit. The question then becomes smoothness vs space. But either way you shake it it is working.

What forum should I use to ask about VS

Hi I really respect the opinions of the people I have found on this forum and as I am getting to grips with visual studio for the first time I often have some questions. I know this isnt a programming forum so I was wondering if anyone knew a good place where I can ask my questions.
(if someone does want to help with my current problem how can I set the full screen resolution to 480x800 for my app, When I use the form property size to do this it works but when I run the app on my device it is zoomed into the origional small resolution area 200x300 or what ever it is)
smart device development msdn forum
Tried setting the anchor to left/right/top/bottom or dock to fill?
Interesting one this, can't say I've really got to the bottom of it yet either. The client area on an application run on an 480 by 800 device is reported as 240x348 in portrait or 400x188 landscape. These values are those returned by C++ in GetWindowRect(), (don't forget to get the size of the Menu/Control Bar at the bottom and subtract it from the above given rectangle), or use the C# form properties this.ClientRectangle.Size.Height and this.ClientRectangle.Size.Width
It appears it is being set by Windows CE/Mobile before the application even gets a look in. This the results from the 6.1.4 emulator image. If I find out any more I'll post it back here.

[Q] Excel spreedsheed for android, filter and functions

Hello, I have new SII (and it is my first android device), I need for it android application that can open my excel spreedsheed with nearly 10000 rows (columns are there just 8) but it needs to be able to do:
1. Open such big spreetsheet
2. Set there filter, enough is "automatic filter" like exist in PC Excel.
3. It must be able use function "summation" (not sure if this english word it correct) simple count all values in selecte area of columns
4. it must be able use function summation applied on filter (subtotal)
5. I must be able sort items as minimum for 1 column, better will be for 3 (like in excel at first sort by colum C, than after B and last after E for example
It can be pait application, no problem, but at first I need know that it can do what I need.
have you tried this?:
https://market.android.com/details?id=com.dataviz.docstogoapp&feature=more_from_developer
No, I did not. I installend free version that is for me nearly useless because it is plain viewer.
Looking how free version works it looks to me that:
summation amd functions will be possible, no problem with it
BUT
Filters are not available.
About data sorting I really do not know.
However I do not have paid version so in fact I do not know. I do not want purchase it if it does not work for me. Ok, may be I can find some support and ask there, but may be there are other applications working.

[Q] Control the cursor

Hi I succeed to finish my code of simple viewer PC screen. Work with WP7
See the video
http://www.youtube.com/watch?v=cCwsuj7Hcno&list=HL1330329890&feature=mh_lolz
Now I will go to try how control the mouse?
About my app I use socket to connect to the server, no RDP protool and its word good. I try it on different machines and networks (@IP) and work perfect.
My app is a last year project so any idea about how to control the cursor.
This probably should have been in the same thread, but anyhow...
It depends on how your protocol is designed. Currently, all the data is pushed from the PC to the phone. To control the cursor, your phone needs to push data to the PC, which means that the PC server app needs to check for data from the phone app.
Sensing a touch on the phone is easy. Sending those coordinates over the network is pretty easy as well; you figured out sending video so I assume you can handle this part. On the PC, you'll want to receive those coordinates and then multiply them back out to their equivalent positions at the PC's resolution. Then you need to move the mouse cursor. There are Windows APIs for doing this, but I've never messed with them. They might be exposed to .NET, but I'm guessing that you'll need to make a call into native code (this is pretty easy, though; look up P/Invoke). Clicking can be implemented by having the phone detect that you tapped the same spot where the cursor already is, and having it send a different message to the server.
The messages will need to be determined by you, as the designer of the protocol. I do recommend using different messages for "move the cursor to here" and "click where the cursor is now." As for when to send the message, that also depends on how you implemented the app. If the entire transmission of the screen frame is one long socket send/receive, you'll have to exchange cursor commands between frames. If you do multiple smaller chunks, you can check for a cursom command and update the position or click as appropriate. Another alternative is to create two socket connections, and have the second one be used for cusor commands. I don't recommend this, though - it's not needed, it takes more code, and although I feel that everybody *should* learn multi-threaded netcode development, I'm not sure it what you want to work on now.
I am really confused
But I will try to get the coordinate of cursor from PC and move it on WP7 screen at first, if I succeed I will develop code tap (click), double tap and drag.
I am really confused
No one can help!!!!!!!!!!!!
Google should be your best helper - try to work with google first.
On WP7 app side you need to grab tap position, translate it to desktop coordinates and send data to the server. On the server side you may use Win32 API function SendInput() http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310(v=vs.85).aspx
SendInput can emulate mouse and keyboard events.
P.S. As for youtube video: try your project on the real device, using WiFi or 3G, and you will understand what RDP protocol was built for
Yes I use Google for that,its the best search engine
I understand that use the coordinates to locate the position, and send it from WP7 to PC.
But my question is how any sample code can hep?

Categories

Resources