yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Development and Hacking General] OdeeanRDeathshead:
You are complicating the issue. evc4 works fine, although my preference is evc3. You should not install anything for wm2005 because it will not work with the free evc packages. Youe system is probably loaded with a mess of stuff that interfears with each other by now. If you clean it all off then just install evc3 or evc4 (or evc3 and then evc4 in that order if you want bothe) it will be ok. When you build your exe, just copy it to your wm2005 device. You can still use the emulator but the 2002/2003 emulators will not show the wm2005 features like back or center sip. Just keep those in mind when you are writing code. Code that works on a 2003 device almost always works properly on a 2005 device, I am hard pressed to think of any code that will not work due to the change in os. If you are thoughra with your code you can make the menus/ toolbars appear anywhere you want top or bottom.

microsoft can say whatever they like but at the end of the day they are just tring to force c# down our throtes. I tried their way and the compact framework is just too limited on ppc. Not to mention that vis studio 2005 is an expensive peice of software that they are trying to make money off. I am sure that ordinary c++ code can be done very well on vis studio 2005 but evc3/4 is still very good and free.

If what levenum said about evc4 being able to connect to a 2005 device is acurate, then just install that and you should be able to stil do everything you want except run on a 2005 emulation. You can debug or whatever on the real device.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Hi KTamas, glad to have you make an appearance.

Do you think VS2005 supports WM5 in terms of Win32? Have you used it?

That would actually be my preference, because the win32 stuff I have written actually looks like a WM5 application. Except I can't seem to get the most basic operation going ie setting the text in a static control.

Yes I'm probably doing it wrong. That's what I'm trying to find out.

If it was to make people buy VS2005, then I can understand some kind of conspiracy by MS. That service pack 4 for evc4, which is needed to support WM5, would by default produce very bad looking apps out of the box.

But what I don't understand, is that given that I have VS2005 with the WM5 SDK, why doesn't it seem to work for Win32? Is it a further conspiracy (as OdeeanRDeathshead suggests) to phase out Win32, and ram .Net down our throats? (I'm not fully against .NET, it has its place for RAD development, I use it at work.) But I want the choice to be able to use Win32, because I like it, and for the PPC platform, which is not that powerful (compared to PCs), you shouldn't have to carry around that extra baggage.

By the way OdeeanRDeathshead, I uninstalled WM5 SDK before I installed evc4 and the service pack. I don't think things are that mixed on my machine. And I can reinstall an image I took recently to fix that if need be.

Actually when you say:

That seems to be very different from my experience.

Firstly, by default in VS2005 you get the WindowsCE2003 SDK, which is what I started using. Everything I tried (including manipulating controls) worked fine for the WindowsCE emulator, and on a WindowsCE2003 real machine. That same code didn't work on my Atom.

Secondly, when I got my Atom I had the expectation that most of the WCE software would work on it. I am really surprised at the amount that doesn't. I have come from owning a Palm (now THERE is a good UI), and I am disappointed at the lack of backward compatibility, almost to point of regretting not getting a Treo 650/700p or something instead.

I would like to ask a question though. Can you write apps that look like WM5 apps using evc4? (Assuming I can actually set text in static controls using evc4, which I haven't yet tried.)
[Windows Mobile Development and Hacking General] KTamas:
VS2005 is *meant* to be used for WM5 Win32 development, as EVC4 does not support the WM5 SDK at all. Also, indeed almost all WM2003(SE) code should work under WM5.

Yes, you can write WM5-like apps in EVC4, just create a menu with 2 items. However, EVC4 has a disadvatage: It is not C++, it was created before the C++ standard released therefore it is not 100% compatible with the "ISO standard" (actually, no compiler is, but the rest of them are much closer). I don't know what are the exact differences though, this is just what I've heard.
[Windows Mobile Development and Hacking General] OdeeanRDeathshead:
IMO the code should work as you had it. If you have read some of my other posts you will know that I have a very low opinion of the Atom. I can't say it is the atom (I actually think its some setting in vis studio) but I suggest trying the code on a non atom 2005 device. The atom is a strange phone and it would be good to rule it out as the cause before searching any harder than you have.

I can't add any more to this topic because I don't know enough about vis studio 2005. I do know that your code worked on my atom with evc3. I hope you sort this out because one of these days I will probably give 2005 a go and I don't want to come up against the same problem.
[Windows Mobile Development and Hacking General] KTamas:
you could post your test executables here and I can try it on my BA WM5.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
I'm pretty sure I mentioned that the code I wrote using VS2005 I ran using the WM5 emulator included with the WM5 SDK. It did exactly the same thing as my Atom did. That's why I didn't bother trying another WM5 device.

Sure I would like to try another device, and thanks for the invitation. I'll post the executable later today when I have time (I'd have to reinstall the WM5 SDK to build it again). Actually how much data can I post here? Is anyone able to try the example project if I posted that too?

As for the Atom being a bit dodgy, I got mine at the end of December, and back then it was terrible. As far as I understand O2 tried (and failed) to rush it out to try to catch the Christmas sales. But it has slowly improved with the later ROM upgrades. By now (except for the camera and the WiFi reliability) I think it is fairly tollerable.

As for evc4 and getting it to look like a WM5 app, I created the default "Hello world" app using the project wizard and that has two pulldown menu items. But they don't appear at the bottom of the screen (as soft buttons). They are at the top of the screen on its own menu bar that also has a close cross icon at the right, right beneath the close cross on the WM5 task bar. Which is redundant given the the close cross at the very top right of the screen. Again this seems different to what you are saying KTamas, that all I have to do is put two menu items on the menu bar.

Anyway I will post the exe later today. And I'll put a bit more in there in terms of message boxes to check results.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Sorry, in the last post it is the WM_INITDIALOG section of the About box's message processing function. Not the main window's WndProc function.

And of course you have to go Help|About to get things to happen.

Just as an aside, I've attached the exe I generated with evc4. Anyone care to see if the menu is at the top or bottom?
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Hey! Where did everyone go?

I posted the exes, and I was hoping that someone would try them and give me feedback.

On reading my post, I may have given the impression that the problem is fixed but it isn't. While both functions seem to set the text in the control, and the correct text is returned when I do a WM_GETTEXT, the control does not actually render the text that it should.

Any ideas?
[Windows Mobile Development and Hacking General] OdeeanRDeathshead:
I tested biop.exe. I cant see how you get the divider in what looks to be a window titile bar at the top of the main window. Can you post the code that creates the first window in evc4 version please. I get no help|about options when I test it so I can't try the code your interested in. To get a title bar like that normally involves making a window a non full screen window (I do not think this is because I can't move it), or using the WS_NONAVDONEBUTTON style.

If the code generated by the wizard is responsible for the title bar i see then the 2005sdk you had on before must be affecting evc4 in some way. I have never had the hello world program come out like that using evc4.

I do not have my atom today so I can't test the 2005 version.

++

The current menu at the bottom (before I run your app) is replaced with any empty menu when biop.exe is running. This is another reason I do not belive the top menu looking bar to actually be a menu in the evc4 sense of the word. I do not know how the up/back ets buttons are created in 2005 but it looks like they are really a modification of the title bar.
[Windows Mobile Development and Hacking General] levenum:
Hi Peter.

It's odd. I check this forum every day many time a day (whenever my work is stuck) but somehow I missed all of the second page on your thread.

It's mystery time now!

First, I checked biop.exe on my Jamin. Yes the menu is at the top. I've seen apps look this way before, both on WM 2003 and WM 2005. Although you are using the right SDK, you chose WCE project from the wizard instead of the Pocket PC project. This is how apps look on clean CE which looks almost exactly like normal windows 95/98. Try compiling with the PPC wizard.

Second, I checked out TestSetText.exe and it worked perfectly. Letter 'A' was changed and the message 'Operation completed successfully' appeared.

I have a theory about your mysterios error. I think it is generated by a previous function call (maybe SHInitDialog(&shidi);) and is somehow effecting subsequent operations. Try tracking it down line by line.

One more thing: On my work computer I've installed VS2005 + SDKs WM5, eVC3 + it's SP (don't remember number) + SDKs, eVC4 + SP4 + (that's SDK for Pocket PC and Smartphone for all versions).

The installations were done in the order I listed the apps in, and for now everything works fine. With VS 6 in there and all the other stuff, its a miracle this 2.4MHz computer with 258MB RAM is still working at a tolerable speed :)
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Hi Guys,

Thanks for the replies.

I'm getting the impression that what is really easy on Windows PC is extremely hard on PPC. This is all about getting a static control to display the text it is set to. But ok, let's carry on. :-)

First the TestSetText executable. I created it on VS2005 using the WM5 SDK. On both the WM5 emulator and my Atom, the 'T' is not changed to an 'A' as (I think) the code should do. Yet on levenum's Jamin, the same code works as it should. (By the way, "Operation completed successfully" is also displayed on both the emulator and my Atom, it's the result of one of the text setting operations saying it didn't work (by return value) but GetLastError not saying anything about the error and instead saying that all is ok.) I'm glad that there is some machine out there that daoes what it should. This is such a fundamental operation I am having trouble believing what I am seeing. Is there anyone else with a different model PPC who can try it? KTamas?

Now the Biop.exe was generated using evc4 with service pack 4. Again this was as simple as you can get. I just created the hello world executable which has a menu with 2 items. And because KTamas said:

I expected the two items to be at the bottom of the screen as the two soft buttons. Instead, the menu bar is at the top (under the normal task bar) and on its menu bar at the right hand side is a close cross. OdeeanRDeathshead said:

The answer is to use the app wizard to create a simple hello world program.

The post is the source code (project files etc) for the Biop program.

That's all I have at the moment.

Thanks Guys.
[Windows Mobile Development and Hacking General] levenum:
Ok, here is a picture to illustrate how you get a menu up or down where it suppose to be.

You have to choose Pocket PC Application for menus and windows to look right.
[Windows Mobile Development and Hacking General] Sleuth255:
Just a thought: what happens if you do an UpdateWindow(hCtl); to force a WM_PAINT right after your SendMessage statement?
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Thanks for the suggestions guys, I'll try both when I get a chance.

As for the WCE Application, I thought that since I had the SP4 installed which supports WM5, I thought WCE Application may have meant WM5 (or generically include it) rather than specifically 2003.
[Windows Mobile Development and Hacking General] levenum:
Ok, lets clear it up:

There is Windows Mobile and Windows CE.

Relevant Windows Mobile versions are 2003 and 5. Relevant Windows CE versions are 4.21, 5.1

Windows Mobile is a derivative of Windows CE with a different shell. It doesn't matter what SDK you are using if you choose a CE project you will get apps that look more like a normal windows app (with menus on top and X button next to OK on dialogs). If you choose a Smartphone project you will get something that looks even weirder on Pocket PC device.

The difference is mainly in resources eVC uses, so if you have an app that has interface components that come from resources (like menus) you must use Pocket PC wizard. If it's a background app you may compile for CE, but it's not recommended.
[Windows Mobile Development and Hacking General] KTamas:
Okay, here is a little table for you guys:

Embedded Visual C++ 3.0: Pocket PC 2002 native

Embedded Visual C++ 4.0 SP4: Pocket PC 2002, WM2003, WM2003SE native

Visual Studio .NET 2003: .NET Compact Framework 1.1 apps

Visual Studio 2005: WM2003, WM2003SE, WM5 native, .Net Compact Framework 1.1 and 2.0 apps

As you see, there is *no way* to compile native WM5 apps under EVC4SP4 (most of the WM2003SE apps work anyways, but using the new WM5 APIs require a bit more work with LoadLibrary and GetProcAddress).

Also, Windows Mobile does NOT equals Windows CE. Windows Mobile is more like a subset of Windows CE.
[Windows Mobile Development and Hacking General] levenum:
Sorry, but I have to disagree with that. You can use WM5 APIs but it takes a bit more work, since you need to use LoadLibrary and GetProcAdress functions.
[Windows Mobile Development and Hacking General] KTamas:
Yes, forgot about that one, sorry and thanks. Corrected my original post :)
[Windows Mobile Development and Hacking General] levenum:
Peter, I got a chance to try testsettext.exe on Mio A701 at work and the result was same as on my Jamin it worked perfectly. I still don't have a clue what the problem may be on Atom and emulator, but thought you should know it works on other devices.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Hi Guys,

I have found a method that fixes the problem for the WM5 emulator and my Atom, but it's a pity I have to resort to this.

The method is to perform the operations I would normally have performed during WM_INITDIALOG during the first WM_ERASEBKGND instead.

So in the WM_INITDIALOG I set a global BOOL to true to let me know the first WM_ERASEBKGND, then in WM_ERASEBKGND if the BOOL is true I set it to false and do all I would normally have done in WM_INITDIALOG. So I have tried initializing a range of controls here and things seem to work fine for the WM5 emaulator and my Atom.

I have posted a small tested executable, FixSetText.exe. I'd appreciate it if someone could try it on a WM5PPC that the TestSetText original worked on (levenum on your Mio?). Just start it, hit about, and in the about box instead of "FixSetText Version" you should see "Text is successfully changed".

I might continue with VS2005 + WM5SDK, but I've run into the next problem. How do you get the menu to change? (Before you tell me edit the menu resource, I know.) There is only one menu entry which has "Help" at the top level. I have edited the menu resource, and changed "Help" into "Menu", the caption says "Menu" when I see it in properties, yet when I run it it stays "Help". Yes, I'll spend time trying to change this one as well, but I'm wondering how much I'm running up against style type stuff hard-coded into the SDK with this one. Are they expecting all WM5 apps to provide help on the right soft button/menu, and forcing it somehow?

So I might spend some time following levenum's suggestion and see if I can get EVC4SP4 going and actually looking like a WM5 app.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Just trying to get an evc4 app started properly.

levenum, you wrote:

Your picture was better than mine, it gave an option for a "WCE PocketPC 2003 Application", and my installation of EVC4 doesn't. That's obviously why I get "up" menus. Do you have any idea what gives you the extra options? Is it another SDK?

What I have installed is evc++V4 and sp4.

Thanks,

Peter
[Windows Mobile Development and Hacking General] levenum:
Hi Peter.

Yes, the option comes from the Pocket PC 2003 SDK. (If you noticed, I also have the Smartphone SDK installed).

The SDK needs to be downloaded separately and installed after SP4.

P.S.

I'll check your app later, but there shouldn't be any problems. You right, it is a shame you have to do it this way, but one has to go with what works.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Pocket PC 2003 SDK

There was an SDK that was installed as part of evc, and I thought it was PPC2003. Ok I'm obviously missing it and I'll download it tonight.

Thanks a lot levenum and everyone else for your help.

Also, if you happen to try FixSetText on a WM5 (or any other) machine, I wouldn't mind hearing the result.
[Windows Mobile Development and Hacking General] levenum:
Hello Peter.

Checked fixsettext.exe on the Mio. Works fine, I got 'Text is successfully changed' when I clicked about.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Thanks levenum, just what I wanted to know.

I finally got a chance to download the 2003 SDK, I'll try it soon with evc4.

I think you said that you prefer evc3? What was better about the earlier version?

Peter
[Windows Mobile Development and Hacking General] levenum:
They are pretty much the same. You only need eVC 3 if you are working with WM 2002 based devices.

Otherwise stick with eVC 4.
[Windows Mobile Development and Hacking General] Peter Bruderlin:
Hi Guys,

Just wondering if anyone can help me with the evc4 platform manager (if that is really what I need). I've read a lot of the description and I am still missing something. (By the way I have installed evc4,sp4,WM2003SDK.)

I have created a standard 'Hello world!' app using the wizard specifying a 'WCE Pocket PC 2003 Application', then found that it wouldn't compile because winver.h was missing. I have changed the include and lib paths to point to the WM2003SDK instead of the original SDK (really tacky to find that you have to manually do this) and it now compiles. I have made no changes to the resulting code.

If I build the 'Win32 (WCE emulator) Debug' configuration, it shows a warning dialog with the following "There is no device installed. Please go to Configure Platform Manager to add a device."

This is really the start of my troubles.

Platform Manager lists lots of devices, why do I have to add one?

It appears that I have to do a lot more than add one, it appears that I have to configure it too. I've gone with Active Sync for Transport and Startup Server, neither of which require configuration. I tested it (after connecting my Atom) and it showed successful.

Compiled again and it showed the same error ie must add a device.

I've been round this loop a couple of times, I have no idea what it really wants me to do.

So I tried compiling the 'Win32 (WCE ARMV4) Release' configuration (which works on my Atom by the way) and got the following:

What the hell does this mean?! One step at a time - my app is Win32, nothing to do with CE.NET - why is it telling me this? What's a shadow platform? I've spent a lot of time trying to find the additional details, but nothing conclusive yet.

Another point seems to be that the emulator does not run ARMV4 code. I find this strange. Isn't this what an emulator is supposed to do ie run the same executable that you would run on the target machine. Am I right in saying that you have to build an emulation specific executable to run it in the emulator? Is that why there is an emulator specific configuration?

After having set up and tested my Atom as a device on the Platform Manager, none of the remote tools work with it eg Remote Call Profiler etc. None seem to find it.

And why does everything seem to point me to the Platform Manager? The docs for the Platform Manager seem to say that it manages remote platforms. Does this include the emulator? I would have thought the emulator was local to the machine, and remote would have meant your PPC connected via Active Sync or something.

All of the above seem to stop me from debugging code, and the only way I have been able to run something is to manually transfer an exe to my Atom.

I think there is something really fundamental I am not getting, and reading a lot of the docs hasen't cleared it up.

What do I have to do to get it to run and debug in the emulator?
[Windows Mobile Development and Hacking General] levenum:
Hi Peter.

Don't take this the wrong way, but you are one unlucky dude. You seem to be getting errors neither me nor any developer I worked with ever encountered.

Unfortunately, the only solution I have for you (since I think your problems come from bad installation of the IDE) is to format the work station, and reinstall everything from scratch.

I can however give you a little explanation about emulator and the platform manager.

Here goes:

1) The platform manager is a component that is installed automatically when you install eVC (I think they got rid of it in VS2005). It manages your target platforms be it an actual device or the emulator which for all intents and purposes is a remote machine.

2) All the emulators that come bundled with Windows Mobile IDEs (including VS5) simulate the OS and device appearance but

not

the processor so they cannot run ARM code. You have to compile your code targeting the emulator.

MS now has a stand alone WM5 emulator available for download which runs ARM code.

Now, I am not sure why it asked you to "install a device". Emulators are installed as part of the SDK and are started automatically when you compile a project targeting the emulator. Also it is strange that you needed to manually configure include path. Choosing an SDK automatically sets the include in project configuration which is why I think eVC or SDK are not properly installed.

Finally I a bit of advice for you:

1) Always install eVC and SDKs to their default directories. Although the installer lets you put them wherever you want I found that changing install directories often causes errors when using the compiler.

2) If you have a device handy avoid using the emulator. It is extremely slow to load and connect and not always accurate.

Well, hope you sort it out.

Good luck.

P.S. "Shadow platform", that's a good one M$!