I want to make an app :D - Windows Mobile Development and Hacking General

Hello.
Do you know a site or thread which has basic instructions about making a "hello world" app for PPC? Just to get me started.
What tools do you guys use? (doesn't matter if they are free or not)
How do you export/publish it as a .CAB?
Thanks.
PS. I searched and didn't find a thread like this and I don't want to use somebody else's thread.

Are you familiar with programming?
I use Visual Studio 2005 to create my apps. It has the ability to create a *.cab file as well
Visual Studio 2005 is not free.
You can find tons of info at the MSDN.

You can also use some library simplifying access to pocketPC by taking care of all necessary OS calls. Xflib looks good, especially if you want to code games, there are also some examples provided with lib download, and sources for most games hosted on their site are available. Might be a good place to start if you'd like to avoid learning winAPI and get right down to coding the actual app Another good thing is that it uses open source ceGCC compiler, so MS Visual C isn't needed. Also, you won't really need to make CABS to distribute programs coded this way, since they consist of one single exe file.
Go to www.xflib.net for downloads and install instructions.

And if you're a total beginner when it comes to programming, I'd try scripting out first. Have a look at mortscript (good because of it's multi-platform usage) or AutoIt (for windows desktop)

Thanks for the answears so far .
I'm not a programming noob, but not profesional. I've done some apps and games. I plan to start with easy things first as a coin toss app... it comes quite handy... or perhaps a handy stuff thing, inclusing the coin toss, unit converting (there are many), dices, chronometer, etc. All with stadistics and many options, like a random mode and a rigged mode ;D for dice and coin toss...
Then move on to something greater, who knows.
For something like that I suppose visual studio is best. I'll try both anyway. Any advise?
By the way is there an emulator like toolkit for J2me? Something a friend can download to run it without a programming software (or a phone).
Thanks again.
Edit: I believe I found an emulator, at least for XFlib (found there).

Device emulators
visual studio has its own device emulators you just have to download the proper SDK's like WM6 sdk or WM5 sdk to be more device specific, it's supports emulator debuging and device debuging but apps made with VS tend to slower and more memory hungry than apps implemented in C. But for me it's the easiest way to app development.

can you post the emulators link or better yet the whole thing itself here if its small enuff? im also working in xflib and would be much easier to use a standalone emulator rather than the one with vs2008. thanks

Related

New Programmer (Maybe)

Hi to all,
i'm new in xda\xda2 world...and i would like to develop under it? What i need for developing? What cpu type\model it have?
Well.. The About and Device Information screens in the System Settings menu should take care of your questions..
But if you're lazy, the XDA typically runs PocketPC 2002 on a StrongArm CPU, and the XDA II PocketPC 2003 (Windows Mobile Edition) on an Intel XScale (which is backwards compatible with ARM).
If you simply visit www.pocketpc.com and click on developers you'll end up at http://www.microsoft.com/windowsmobile/information/devprograms/default.mspx
Where you can even order a free DVD-Rom with the PocketPC SDKs, compilers etc (they will charge shipping and handling, at a freakishly high rate). You can also download that stuff.
However, you will need Visual Studio .NET as well, which is not a free download (in fact, even the academic version will set you back more than EUR 100).
I've not ventured into it myself yet, so it's quite possible you can actually do without Visual Studio (as the compilers themselves can be downloaded). Also, there's a version of gcc for pocketpc.
Any one developing for pocketpc who wants to chip in here? (I'd like to toy around with programming a bit on PPC - regretably it doesn't have a built-in scripting language like epoc32 has/had).
You only need Visual Studio .NET if you want to create .NET applications. If you are just programming in C++, I'd highly recommend downloading Embedded Visual Studios 3 and 4 and get the appropriate SDKs (all of which are free). At least, that's what I use.
What about Java Midlets?
I am thinking on writing a couple of apps for PPC, but going into VS.NET might be too deep for me. I also want to extend those later for palm and maybe desktop. No hardware specific stuff so I thought I might get away with Java which I am pretty good at.
Does anyone have anything to say - pros / cons? How midlets are on O2 in general - fast / slow, too much memory or processing power? Please share.
Why don't you get down to c++? Fast, small, general support...
--------------
У нас сегодня день вежливости, так что вы просто идите за мной и никуда не сворачивайте!
Some day
Good old C++. Too many years with Java - softened my mind... Undoubtedly C++ is the best way to go in terms of speed and size. Lets see what people say. :idea:
I've been programming in Visual .NET (VB.NET more specifically), but even after installing the SDK I have no idea where to start? When creating a project, I don't see any new project type for Pocket PC applications ? In fact, what else do I need to do if I want to program in VB.NET ?
i read that visualstudio .net 2005 will be able to make pocketpc applications in all languages not just .net applications like 2003
not sure about how you get started with vb.net since vb is very evil and nasty
but with c++ mfc and c# .net you start out with a form and there you can place components on it and program what functions they have
but if you want to make games and stuff which dont use normal windows stuff then you are better off programming them in c++ directly for the arm platform
I use Embedded VC++ and MFC as it's far tighter/smaller than .net. Purists can go completely Win32(ce) native and avoid MFC altogether but MFC does make development a good deal easier without the bloat of .net (not to mention how slow it is..).
Same thing for me. C++ with EVC tools. No mfc for me (a little purist and feel it gives a clearer code )
Best way to have samller and optimize applications
I've been programming in Visual .NET (VB.NET more specifically), but even after installing the SDK I have no idea where to start? When creating a project, I don't see any new project type for Pocket PC applications ? In fact, what else do I need to do if I want to program in VB.NET ?
Click to expand...
Click to collapse
If you have VS.NET 2003 you don't even need the SDK.
just File-> New->Project
on the left column "Project Types" choose your language and on the right click the "Smart Device Application"
Basically is like any windows application but less possibilities and if you want to create any serious application you'll have to do a lot of optimization and native coding.
Good luck
Books?
I'm also interested in programming with Embedded VC++...and was wondering if anyone know of books out there I can pick up that will help my learning process a little quicker. Its been a long time since i coded in C++ and need to refresh.
The part I'm really need help is the basic parts ...like how to get things started.
I'm confident that once I get started i'll start to remember my C++ coding.
I'm downloading the Embedded VC++ from Microsoft as I type this post ...hope it wont be too hard to understand how to create a simple "hello world" program for PPC devices
Also if anyone knows a good web sites with code samples ...please PM or post the URL, I'v seen some but not all that great
Thank You
Sometimes less is more.......
zendrui said:
Same thing for me. C++ with EVC tools. No mfc for me (a little purist and feel it gives a clearer code )
Best way to have samller and optimize applications
Click to expand...
Click to collapse
As mentioned above, if you drop ATL, MFC .NET and all the implied baggage they have to bring with them to work, you are left with the old WIN32 programming model. This is now considered very 'old hat', but if all your program uses are API's in WIN32's kernel.dll, user.dll, gdi.dll etc...... i.e. the very primative windows stuff, then it is possible to write an application that will run on any version of Windows Mobile. This application will be pretty simple, but the compiled .EXE file targetted at an ARM4xx model will run on almost any Pocket PC, without any other files. (i.e. The single APP.EXE file will run on any upwardly compatable system, no fancy implementation project to create or run, just copy the release '.exe' file to the target machine, and it will run!). These days 99%+ mobile PDA's run ARM class processors. The manufacturers call them by their own processor IDs but under the hood they are all the same.
To create an app that will run on the Mobile 5/6 platform without looking like previous Mobile 2002/3/SE apps, limit the Main menu items to two. This will make sure they appear either side of the input icon, as menu items. More than two and the Mobile 5/6 menu items appear as 2002/3/SE apps in the old control bar style.
wfberg said:
(I'd like to toy around with programming a bit on PPC - regretably it doesn't have a built-in scripting language like epoc32 has/had).
Click to expand...
Click to collapse
As far as scripting goes... I'm a big fan of Mortscript. It's so simple... I guess I'm a little purist myself
Basic 4PPC
Basic for Pocket PC, has anyone tried this. I went to the site and it only cost around 40.00 US. I've worked with "basic" before and the progs were usually bloated and sluggish. Wonder if this would be the same.
i have started developing in ppl language the program name is PIDE from ariana soft..its very easy..it also lets u make games
ive created my first clock in it

Reading the registry with Visual Studio 2003

I'm developing a small application for my HTC Wizard, which I'm programming with Visual Studio 2003.
I need to open the shell application for M3U files, which I've tracked down to HKCR\M3UFile\Shell\Open\Command... but now I can't figure out how to either read that key to open the relevant player, or to execute the m3u file directly.
Because I'm using VS2003, I don't have access to system.win32 with the compact framework, so what techniques have others of you used to read or write to the registry?
Also, just as a side note, how do you find the current path?
Thanks,
Jon
There is no real concept of current path in CE. If you want to know the path your EXE is in, use GetModuleHandle(NULL) -- it'll return the fully-qualified path name of that process's EXE, from which you can parse out a path.
I'd advise against using the compact framework; .Net is a loser on PPCs as it just slows things down, taking up extra memory & cycles on a platform where both are in short supply. Use the real Windows APIs instead -- i.e. call RegCreateKeyEx/RegSetValueEx.
And if you choose to use Win32 API you can just call ShellExecuteEx()
and not mess with the registry.
RegQueryValueEx is what you need. Just set the appropriate type and buffer.
V
I'm always willing to learn new stuff... are there any good resources on programming for PPC without using .net?
I know there's EVC++, but I've installed it, and now I don't know what to do with it!
Regards,
Jon
JonTheNiceGuy said:
I'm always willing to learn new stuff... are there any good resources on programming for PPC without using .net?
I know there's EVC++, but I've installed it, and now I don't know what to do with it!
Regards,
Jon
Click to expand...
Click to collapse
You can either use EVC++4, which is free but has an aged, not-so-standard C++ compiler (since it based on VC++6...but it only means a few quirks), or you can use Visual Studio 2005 which is supposed to replace EVC.
Jon, not to state the obvious, but there are many c++ tutorials for the PPC on the interweb.
What kind of experience do you have?
V
I have no prior experience with C++ - I bought the C++ For Dummies book in a charity shop a month or so ago, but it seems to refer to software that isn't available any more!
My core experience is with PHP, and recently I've been more interested in VB.NET for small apps at work, but most of what I want to do is with Windows Mobile - for which, all I have is Visual Studio 2003, and my co. won't fund me buying VS2005 as I got it for an old project that I still maintain, and anything new I need to write for work I can do with VS2005 Express...
That said, I'm not afraid of learning a new language, especially something as powerful as C++.
C++ for dummies is excellent, the best I've come across so far.
Have a read through this:
http://forum.xda-developers.com/viewtopic.php?p=209136#209136
I'm currently unlearning and then relearning my c++ - one thing I've learnt coming from other languages - c++ requires discipline. It's not about shortcuts, you build up from the basics and keep going steadily. But you need to be logical, and prepared to put in the effort. So discipline - it's been a long time since I've had to think about that!
V

eVC4 with sp4 - How to begin?

OK, I have absolutely no programming experience beyond creating some batch files in DOS, way back in the day, and some even earlier experience trying to learn BASIC (on an ADAM computer, no less....).
I've dl'd eVC4 with sp4, opened it up, and begun reading the help files....
Unfortunately, this is about as foreign to me as trying to read a Mandarin Chinese primer written in Russian....
My initial goal is to gain an understanding of .CAB files, and write a few of my own.
Any suggestions on how to find a good starting point? I have a brain, but I also need a good reference point.
Any help would be greatly appreciated!
If you just want to create cab files I'd recommend you use WinCE Cab Manager instead. It's much more easy to use, and provides way better understanding on how cab files work than eVC4
If you really just want to pack a few things then as nomad suggested you should get the Cab Manager.
Though there is not much to learn about cabs as they are made by cabwiz.exe (a file which comes with the Pocket PC SDK you also need for eVC).
It reads a inf file that lists files to include in installation, shortcuts, and registry setting. All of it is documented here.
If you want to get in to writing apps, you should first get a good book on C/C++ or on another programing language should you choose it.
Currently WM development supports C/C++, VB .NET, C# and JAVA (in somewhat awkward way)
Once you learn basics of the programing language you can move on to Win32 programing which is the base for both desktop and pocket PC OS.
It's a bit of a long way, but there isn't much choice if you want to really understand what you are doing / can do.
I started with an excellent book called "complete guide to C" (it was a translated version so name may vary, black cover big C on it) then moved on to a 1000+ page Visual C++ and MFC book from MS.
Is this link the latest eVC version available?
http://www.microsoft.com/downloads/...3D-50D1-41B2-A107-FA75AE960856&displaylang=en
It looks like you install eVC then the latest SP for it which appears to be SP4
http://www.microsoft.com/downloads/...F4-91D3-4DBE-986E-A812984318E5&displaylang=en
If you have Visual Studio 2005 and the WM5 sdk is there any reason to install eVC or is it included or obsoleted?
Not that I'm one to speak, I'm very much a learner, but I posted way back about some of my pains in learning to program in c++.
http://forum.xda-developers.com/showthread.php?t=253443&highlight=brain
V

New programmer on pocketPC... advice?

hey guys, I'm a career developer with tons of experience in a lot of things except PocketPC. I want to play around a bit with PPC, but would like to hear about the development platforms, languages, etc. that you're using and what you like about them. I don't know anybody personally that's even remotely interested.
I'm currently using VIsualStudio2005/C# for my day job, and am pondering whether that's a good fit for PPC. A lot of documentation exists for both managed and native PPC C# code. Managed code is more like the stuff I do all day.
What I've found so far is that managed code requires runtimes to be installed (already there on WM6 i hear), there's a noticeable delay when starting a managed program, and a lot of functions are missing from the .NetCF.
I'd probably be writing business apps (database stuff, web back-end client/server, etc.) as well as hacks like today plugins, utility programs, etc.
Should I just start right out with native coding, or try and hack away with managed code. What's your opinion?
roboHaxx,
As i'm sure you're already aware of, choice of language on this environment really depends on the application you're designing.
I tend to use Visual Studio/C# for applications that I need to develop rapidly where I'm not too concerned about load times. The .NetCF libraries really helps in ensuring things get done quicker but there's a tradeoff in speed and functionality but not by too much thanks to all the new spec devices that are coming out.
If I'm developing something that doesnt need to get done faster, and I need quick loading times (like today plugins for example), I tend to stick with C (evc4).
Personally I stay away from .NET and all related stuff like it was toxic waste.
As kunz wrote it is too slow for PPC (at least for now) and if you want to use the .NET CF 2 any user with a device prier to WM 6 (which is the majority for at least another year) will have to install 5MB worth of run time.
But there are some very nice apps made with CF already out there like Hitchhiker so it defiantly has its place.
One problem though: if you want to develop system components like today plugins, keyboards (SIP) or control panel applets you will need a component written in C / C++. All those are DLLs that the system expects to export certain functions. This can not be done with managed code, and as far as I know not at all in C#.
One final recommendation: look up all threads started by Vijay555.
He wrote a pretty good summary of programing tools and options for WM devices somewhere on this forum.
Thanks for the replies. I'm think I'm starting to get a grip on this platform.
Sounds like the same principles as programming on a PC. For business apps (like in my day job), the managed, quick-to-market environments like C#, .net and CF2 prevail. But for performance, versatility and access to everything, C is the way to go. C++ if you must.
by the way, I thnk you can create DLLs in any Visual Studio language. I do it all the time with C# and VB. Now whether these DLLs can export the functions that are needed in PPC, I don't know the answer to that.
kunz, you said
If I'm developing something that doesnt need to get done faster, and I need quick loading times (like today plugins for example), I tend to stick with C (evc4).
pardon the dumb question but, what is evc4? A compiler I presume. That was going to be my next question. Which compilers do you like?
eVC is eMbedded Visual C++ 4.0 its a free C++ IDE for Windows Mobile from Microsoft.
It is almost identical to VS 6 (if you are familiar with it).
It won't except WM 5 or 6 SDKs, but any program create on it (with WM 2003 SDKs) will run on any Smartphone or Pocket PC starting with WM 2003 through WM 6.
For older versions you will need eVC 3.
The following pages should provide some useful information:
http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.HomePage
http://www.pocketpcdn.com/tools/index.html
Enjoy!
Hi,
I am programmer but I'm new in mobile development too.
I have an ideal to write a program that can speak the caller number instead of ringtone. The problem is that I don't know how to get the receiving call events.
Can we solve this situation with .net compact framework?
Anyone have documents to share?
Thanks

Getting into WM5/WM6 programming?

I am interested in dabbling a little in programming for my Kaiser. I have programming experience, mainly php / mysql, though I have done some C and lots of scripting in my time. My biggest project so far though was an open source google maps mod to put on your website - thousands of lines of php / js code, mysql backend and AJAX tieing it together, some graphics routines etc, so I am no drooling n00b when it comes to coding.
How easy is it to develop basic stuff in WM?
I have access to MSDN, so I can get Visual Studio (2005 for sure, maybe later versions), so I think I have access to the apps I would need. I just ordered some books to help me along, but was wondering if I would likely face a steep learning curve.
All the stuff I want to do is today screen plugins - was thinking of having a bash at writing my own quick contacts plugin - *very* basic - just a vertically scrolling list of names over a transparent PNG button with maybe photos from the address book - I want it to be able to scroll by vertical gesture within an ultimatelaunch tab - is this likely to be quite easy and quite a good "first app" to program?
I was also looking at writing a lite repacement for phoneweaver as the only feature I use is to turn on BT when it detects power but no activesync (ie auto turn on BlueTooth when I am in the car and the device is cradled) - maybe a hack to force the keyboard backlight on in the same situation.
I have bought:
Microsoft® Visual C#® 2005 Step by Step (Microsoft)
Microsoft® Mobile Development Handbook [Paperback] by A. Wigley; Daniel... (Microsoft)
Comments / suggestions?
I would also be very interested in a thread or good reference on how to start to program app for mobile gadgets. Actually i'm a Delphi coder, and i would like to implement some applications on WM platform, but when i search over internet there's plenty of information, but no usefull information with "real-life" recomendations.
depend on the platform and language one wish to use really
there is c#.net, vb.net c++.net
c++ miniMFC, c++ PureWin32 sdk
oldVB
...
here are some other posts asking pretty much the same thing from the forum
http://forum.xda-developers.com/showthread.php?t=225405&highlight=programming
http://forum.xda-developers.com/showthread.php?t=237932&highlight=programming
http://forum.xda-developers.com/showthread.php?t=241670&highlight=programming
http://forum.xda-developers.com/showthread.php?t=245426&highlight=programming
http://forum.xda-developers.com/showthread.php?t=228043&highlight=programming
http://forum.xda-developers.com/showthread.php?t=317913&highlight=programming
http://forum.xda-developers.com/showthread.php?t=302548&highlight=programming
http://forum.xda-developers.com/showthread.php?t=327164&highlight=programming
http://forum.xda-developers.com/showthread.php?t=305926&highlight=programming
http://forum.xda-developers.com/showthread.php?t=336251&highlight=programming
http://forum.xda-developers.com/showthread.php?t=226412&highlight=programming
codeguru.com got examples of various windows mobile programs too today items and such
about delphi i dont know if anybody got some info i would say borlands site
Thanks rud. I was aware of various other posts, but my question was more of a "How steep is the learning curve?" rather than "How do you do it?".
There was also an element of "How do you do it?" insofar as there seem to be better or worse ways of going about various kinds of app (eg today apps with gesture support) which I am finding a bit of a minefield, but I feel that the new post was valid because I am giving an indication of my experience level and what I am trying to acheive - none of the posts you listed cover the combination of stuff I am trying to do. Reqs like pulling from outlook db and allowing gesture scrolling in a today plugin, I dunno, I may waste ages with C#, for example, only to realise it is a breeze with C++... I also note that a google search for wm programming gesture scroll today screen currently ranks this very thread #5. By tomorrow that'll be a googlewhack then.
Yes, there are various posts about how to get started, but I think maybe a sticky would be in order with a bit of info on the various paths - the vb/c++/c# options are quite bewildering - stuff like
levenum said:
Your question is mainly a matter of personal preference.
Here is my opinion on C++ vs. C#:
C++ advantages:
- Native code is faster than .NET
- Easier access to Win32 APIs
- Ability to write system components like keyboards and today plugins.
C# advantages:
- Saves on coding time
- Allows use of many .NET CF components to quickly accomplish complex tasks.
Please note that I am bias. I hate .NET and want nothing to o with it. Specially on mobile devices that do not have the processing power to spare for the .NET overhead.
Click to expand...
Click to collapse
is really useful, maybe if it were expanded upon, info such as for this route you need visual studio, etc, etc it would make a really good sticky for the dev section.
evilc said:
I am interested in dabbling a little in programming for my Kaiser. I have programming experience, mainly php / mysql, though I have done some C and lots of scripting in my time. My biggest project so far though was an open source google maps mod to put on your website - thousands of lines of php / js code, mysql backend and AJAX tieing it together, some graphics routines etc, so I am no drooling n00b when it comes to coding.
How easy is it to develop basic stuff in WM?
I have access to MSDN, so I can get Visual Studio (2005 for sure, maybe later versions), so I think I have access to the apps I would need. I just ordered some books to help me along, but was wondering if I would likely face a steep learning curve.
All the stuff I want to do is today screen plugins - was thinking of having a bash at writing my own quick contacts plugin - *very* basic - just a vertically scrolling list of names over a transparent PNG button with maybe photos from the address book - I want it to be able to scroll by vertical gesture within an ultimatelaunch tab - is this likely to be quite easy and quite a good "first app" to program?
I was also looking at writing a lite repacement for phoneweaver as the only feature I use is to turn on BT when it detects power but no activesync (ie auto turn on BlueTooth when I am in the car and the device is cradled) - maybe a hack to force the keyboard backlight on in the same situation.
I have bought:
Microsoft® Visual C#® 2005 Step by Step (Microsoft)
Microsoft® Mobile Development Handbook [Paperback] by A. Wigley; Daniel... (Microsoft)
Comments / suggestions?
Click to expand...
Click to collapse
Hey!
Congrats on getting your hands on with Windows Mobile...
The easiest way is to download Visual Studio 2005(2008 You have it on MSDN) - and create a new application with it.
It's sooo easy if you know your object oriented programming, as long as you want to create ordinary "office" applications... But if you want to do more advanced things(like creating a today-plugin) you need to go over to c++(even though you can download a .net home-plugin-container which acts like a "loader" for your plugin written in c++) - and also, if you want to create good GUIs, I think you are better off with c++... But then again, I think you need a bit more effort in learning c++ then using c#...
Hope this helps...
Still slogging my way thru this...
I got hold of an MSDN disc, first off I installed visual studio 6 - bad move.
Had to uninstall before trying to install VS 2005, now I think it has screwed something up, every time I try and create a "Smart Device Win32" project, I get a "Project creation failed" error. I may have to re-GHOST my OS to get rid of it
So much time just finding out what apps I need and what options to choose to start a project...
I found http://channel9.msdn.com/wiki/default.aspx/MobileDeveloper.HomePage which seems helpful
Thanks for responses!
Evilc, you link of msdn is excellent point, many thanks!
I have also just started programming in C++ ..i dnt have any knowledge of any type of codes..i learned every thing frm MSDN libraries ( i have many many of them caz i have VS 2006 VS 2005 and VS 2008 )..i recommend you to work with C++ because it uses less system resources and is fast..hope this helps..check out my Kitchen coded in C++ ( link in signature )
Yeah, I think C++ is definately more what I am looking for from what I have learned thus far.
Re-Ghosted OS - totally fresh XP SP2, installed Visual Studio 2005, still the same error. GRRR!
Visual C++ --> Smart Device --> Win32 Smart Device Project == "Project Creation Failed"
Other Languages --> Visual C# --> Smart Device --> Windows CE 5.0 --> Device Application == Project created OK.
Some posts I have found on the net say it is an IE7 issue, I may try uninstalling that or flashing back to an OS image with IE6 only, but this is really winding me up and taking a *lot* of my time...
I uninstalled IE7 and the problem went away. Woohoo!!
starting programming windows mobile
hello
1. see my web site.
2. see my book recommendations, especially the 'programming windows ce' by douglas boling. It has an example for many things and a today sample too. Most is based on visual c++ 3.0/4.0. Embedded Visual C 4 can be loaded free of charge at ms.
regards
josef
Nice site, thanks.
The windows mobile 6 sdk actually has a today screen sample, along with samples of most of the things I need to do.
neofix said:
It's sooo easy if you know your object oriented programming, as long as you want to create ordinary "office" applications... But if you want to do more advanced things(like creating a today-plugin) you need to go over to c++(even though you can download a .net home-plugin-container which acts like a "loader" for your plugin written in c++) - and also, if you want to create good GUIs, I think you are better off with c++... But then again, I think you need a bit more effort in learning c++ then using c#...
Hope this helps...
Click to expand...
Click to collapse
Are we using the same language?? Cos this (C++ Win32 for Mobile Devices) is by far and above the most difficult programming language to get into that I have ever tried. Yes, worse than ASM.
Trying to code an app that prints "Hello World" has taken me over 5 hours with no success yet - most languages I have a go at it's 5 minutes.
From http://msdn2.microsoft.com/en-us/library/ms901121.aspx :
Code:
int DrawText(
HDC hDC,
LPCTSTR lpString,
int nCount,
LPRECT lpRect,
UNIT uFormat
);
It gives a brief description of what the parameters are, but absolutely no examples and no explanation of what all the parameters do or how to initialize them, so even browsing an example is no use to me.
u can simply try
MessageBox::Show(" your message ");
ather90 said:
u can simply try
MessageBox::Show(" your message ");
Click to expand...
Click to collapse
Isn't that .NET ?
I thought the consensus was that Native Win32 or whatever it is called was the better way to go?
This is part of the problem. I cannot even work out what to put in a search engine to pull out info on the right "flavour" of C and for the pocketpc. It's *so* bewildering.
Hello evilc.
First I noticed you have some trouble with VS 2005. It probably won't be easy now, but if you ever get to format your machine again don't install it (unless you absolutely need some other features).
For C / C++ programming for WM device I strongly recommend eVC 4 as it is much lighter and responds quicker. (It's a free download as well)
Second, though you can program for WM in C# and VB .NET which are both .NET Object based languages and are probably much closer in form to PHP and Java then C, you can not write system components such as today plugins in those languages.
You need native code so C / C++ is the only way to go.
(Actually, there is a trick to combine C# and C++ DLLs to create a today plugin where C# will do the main stuff, but its pretty complicated)
What you need is to learn basic Win32 programming and using the windows API. They are almost identical for Windows Mobile and Desktop windows versions so any book on Win32 should teach you the basics.
(Personally I started with MS book on MFC and studio 6 but I would not recommend it)
Finally:
I would gladly explain the parameters of DrawText but I am not quite clear on how much familiarity you have with the Win32 mechanics, since the languages you are used to obscure them unlike C which gives you extra power but also makes you work much harder to get anything done.
Do you know how to handle messages, and how windows manages all abjects using handles? Any familiarity with GDI?
If not, it will be pretty difficult to explain.
levenum said:
Hello evilc.
Click to expand...
Click to collapse
Hello! <waves>
First I noticed you have some trouble with VS 2005. It probably won't be easy now, but if you ever get to format your machine again don't install it (unless you absolutely need some other features).
Click to expand...
Click to collapse
I tracked down the problem when I got home and installed on my desktop. When doing it on the laptop, whilst installing SP1 for studio 2005, I had hit "Not Now" to a reboot request and it had said installation failed. When I installed SP1 on my desktop and said "Yes" to the reboot request, the problem went away, so I guess it was fixed in SP1 but the installer is a bit picky.
For C / C++ programming for WM device I strongly recommend eVC 4 as it is much lighter and responds quicker. (It's a free download as well)
Click to expand...
Click to collapse
Wish I had that advice before as I wasted a day messing around with an MSDN CD, trying to work out what to install and what not. So does the eVC 4 download include an IDE? If not, what do you use?
Second, though you can program for WM in C# and VB .NET which are both .NET Object based languages and are probably much closer in form to PHP and Java then C, you can not write system components such as today plugins in those languages.
You need native code so C / C++ is the only way to go.
(Actually, there is a trick to combine C# and C++ DLLs to create a today plugin where C# will do the main stuff, but its pretty complicated)
Click to expand...
Click to collapse
You don't have to tell me twice to avoid the bloatware ****e
What you need is to learn basic Win32 programming and using the windows API. They are almost identical for Windows Mobile and Desktop windows versions so any book on Win32 should teach you the basics.
(Personally I started with MS book on MFC and studio 6 but I would not recommend it)
Finally:
I would gladly explain the parameters of DrawText but I am not quite clear on how much familiarity you have with the Win32 mechanics, since the languages you are used to obscure them unlike C which gives you extra power but also makes you work much harder to get anything done.
Do you know how to handle messages, and how windows manages all abjects using handles? Any familiarity with GDI?
If not, it will be pretty difficult to explain.
Click to expand...
Click to collapse
No GDI Experience. I take it this would be the library of choice for drawing the screen of a today screen app? Stuff like the HTC Home clock or the new Face Contacts - they would likely use Native C++ and GDI? Doesnt strike me as something you would do with a form.
Also, anyone got the skinny on vertically scrolling by click-and-drag inside a today screen app? Just a case of enabling a parameter? Has to be coded manually? Best way to do it smoothly? If you have seen the Conduits Pocket Player 3.x browse list - how it "eases in" and "eases out" at the ends of the list, has inertia so you can "flick" down the list, the alphabetical bar instead of the regular scroll bar - is that all coded manually or is there an api or something that can help?
Thanks for the help!
I just noticed your apps in your sig - checked out LVM time - noticed there was source - wooohoo! I generally pick these things up by example.
All that code just for a (configurable) clock on one line - wow. Great though, a really good example of a today app - minimal enough in functions so it is easier to suss how it all slots together, but full featured enough (implimented example of an options screen - yay!) to show how to do various things.
And Gnu as well! Nice, this will be the basis of my first test project too I think - at least now I have a framework to test out what I want to do and how to go about it without having to work out how to code the basis of the application.
I thank you from the bottom of my heart sir.
I tried to build it in VS2005, but I got a
fatal error C1083: Cannot open include file: 'todaycmn.h': No such file or directory
A quick google search showed todaycmn.h was part of the SDK, I found the file, dropped it into the headers section of the project, but no joy. I will probs just try eVC.
Oh, and having developed a today plugin, maybe you can answer this one:
As far as I can tell so far, debugging isn't very easy with a today app - something to do with the fact that the dll is not releasable? Is this an issue I will come up against? I hope its not a case of "reinstalling" the app each time you want to test... I was thinking maybe along the lines of have it as a normal app for debugging, then make it a today plugin when you want to build to use it?
I dunno, probably trying to run before I can walk, my books shoulda been here today, oh well. Sorry for all the questions...
@evilc:
Are you using standard Win32 or MFC?
You may want to try using MFC since you get the flexibility of native development but with some nice class libraries that make your life easier.
As for click and drag behavior, that is usually implemented by handling the WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE.
When you get wm_lbuttondown you set a flag that says the user is dragging. You use wm_mousemove to update the stylus position as long as this flag is set, then you unset it on wm_lbuttonup.
That's the basic idea anyway. Someone made a post about gesture recognition in this forum a few weeks ago with sample code. You should see if you can find that.
Managed Today Screen plugins
See:
http://msdn2.microsoft.com/en-us/library/ms839442.aspx
for some background on the concept.
And:
http://www.christec.co.nz/blog/archives/279
Outlines what I think is a very ingenius technique for managed today screen plugins.
For those of you that want an easy way to make a today screen app in c#. Chris did all the C++ work for you.
Also I forgot to mention that the SDK samples cover all most every application type you can think of. Most of the good ones are Win32 though.
Also, keep in mind that you can use P/Invoke from your C# apps to call native APIs. So don't let people tell you you need to use C++ just because you can access more api's. I will say that you should use C++ for games, or other apps that require high speed or advanced GUI's (it is VERY hard to do interesting gui techniques with C# and interop, trust me).
And finally, I would highly recommend using the most recent version of visual studio you can get (especially if you're using vista), unless your machine can't handle a newer version. I say so because visual studio gets more and more powerful as an editor with each new iteration and I personally can't go back after I get used to the new features they introduce. And the new versions are almost necessary if you're going to do .net development.

Categories

Resources