Log in

View Full Version : eVC++ Hello World


Mark Johnson
12-29-2005, 11:18 PM
OK, I'm taking my first stabs at VC++, and this is really interesting. I'm coming from a VB background.

I'm trying to play around with the most simple possible Hello World program I can start out with. I'm actually amazed at the complexity of the sample that Microsoft supplies. It has almost 200 lines of code just to say "hello world!" Yikes!

Can anyone familiar with eVC++ help me pare this down? Or point me in the direction of a different (more simplified) sample? The Microsoft sample includes things like a "Help/About" info subform, an actual Menu Bar, and other items that are complicating the project beyond what I'm trying to wrap my mind around at this point.


What I've done so far:

1) I downloaded eMbedded Visual C++ 4.0 (Core developer environment)
http://www.microsoft.com/downloads/details.aspx?familyid=1dacdb3d-50d1-41b2-a107-fa75ae960856&displaylang=en

2) Patched it with Service Pack 4 (Latest service pack)
http://www.microsoft.com/downloads/details.aspx?familyid=4a4ed1f4-91d3-4dbe-986e-a812984318e5&displaylang=en

3) Added the Mobile Application Development Toolkit (Device specific SDK)
http://www.microsoft.com/downloads/details.aspx?FamilyId=F4328333-0FD4-4348-88C0-39D10FB64F0A&displaylang=en

4) Downloaded the Developer Resources for Windows Mobile 2003 Second Edition (Sample apps)
http://www.microsoft.com/downloads/details.aspx?familyid=6A34DC83-C3CE-4A4C-AB83-491FD5729551&displaylang=en

5) Opened the sample Hello World at
C:\Program Files\Windows CE Tools\wce420\POCKET PC 2003\Samples\Mfc\Hello

ppcinfo
12-30-2005, 02:31 AM
I suggest you get the book by Boling called "Programming Microsoft CE .Net" which has wonderful examples (and comes with a CD). The coding examples are written in WIN32 not MFC, so that can be less complicated and more readable.

ppcinfo

Guest979
12-30-2005, 04:27 AM
Wouldn't you need Microsoft Visual Studio .NET to write code like that? I have VS2003 from a class I took, but I don't get an upgrade to 2005... :(

SteveHoward999
12-30-2005, 05:37 PM
Not for eVC. If you want to do .NET programming for Windows Mobile 2005 then you HAVE to use Visual Studio 5 (or notepad).

You can then build programs that use Compect Framework 2 (.NET 2 for mobile devices) to build code for Windows mobile 2003, 2003SE, 2005 and beyond. Pocket Windows 2002 or earlier is not an option with VS 2005.

Guest979
12-31-2005, 12:27 AM
My post was in response to ppcinfo - so I think you're saying I'm right...?

SteveHoward999
12-31-2005, 01:19 AM
My post was in response to ppcinfo - so I think you're saying I'm right...?

I was saying you don't need VS 2005 for eVC programming.

But you do need it if you want to program using .NET for Windows Mobile 2005 or if you want to use the Compact Framework 2 for WM 2003 or later.

eVC is a lower-level programming language ... and as such is harder to use than any flavour of .NET programming. You have to know more and write more code to achieve the same thing in .NET.

I've just started doing PocketPC development and deliberately chose C# instead of eVC coz it will hert me brayn less.

Mark Johnson
12-31-2005, 06:11 AM
I've just started doing PocketPC development and deliberately chose C# instead of eVC coz it will hert me brayn less.

Yeah, my "transition" from VB to eVC has so far been basically a swan dive onto concrete. The good news is that I've managed to take the Microsoft sample Hello World and cut it down from about 200 lines of code to around 50 after ripping out the extraneous junk like the "help/about" screen, etc.

I feel like Alice in Wonderland, but it's starting to be interesting. But it DOES hert. We're talking extra-large, extra-cold Slurpee downed in 60 seconds brain-freeze pain here...

If only there was consistent support for VB from PPC2002/PPC2003/WM5, etc. I'd have finished my project days ago. I can understand why MS killed it (it is kinda weak), but I hate that they killed it (it's like a Swiss army knife: it's not really "exceptional" at any of the things you can do with it, but boy can you do a bazillion things with it!)

JonMisurda
01-01-2006, 04:04 AM
If I were to suggest a slightly different approach, I think that the easiest transition from VB to VC++ is by creating a new project through the AppWizard that is an MFC application that is dialog based.

This is very close to the VB startup form, and you can add controls through the resource editor.

You can then attach events to the controls by using the class wizard (CTRL + W) and handle events such as button clicks.

Don't want to confuse you by showing you too many different ways, but this might ease you in to the whole windows via C++ thing a bit easier.

Jon

sriram_2001
02-17-2006, 11:05 PM
VS 2005 has support for building smart device apps using C++ (basically everything that eVc could do...and more). Going forward, we're recommending that people use VS 2005 for their native development

Also, VS '2005' has support for WM2003 devices as well

Sriram Krishnan
PM
Visual Studio for Devices

Guest979
02-18-2006, 07:13 PM
VS 2005 has support for building smart device apps using C++ (basically everything that eVc could do...and more). Going forward, we're recommending that people use VS 2005 for their native development

Also, VS '2005' has support for WM2003 devices as well

Sriram Krishnan
PM
Visual Studio for Devices

Yes, I understand that, but I think the issue we're discussing is that the embedded C++ development environment can't compile .NET code, and my understanding is that, similarly, Visual Studio can't compile the older style code. They can both create PocketPC programs, but don't you have to use different coding techniques?

sriram_2001
02-18-2006, 10:07 PM
The native C++ support for devices in VS 2005 is similar how VS lets you write Win32 applications in C++ - it has nothing to do with managed code.

I'm not sure what you mean by 'old style code'. eVc code should run with a few tweaks . When you open your eVc project, they're run through a migration wizard which converts the project files into VS 2005 format

gwinter
02-25-2006, 03:53 PM
Edit: Updated according to Sriram's post below.

I think a summary is in order:


Target Environment Tool

WinCE3, PPC2000, PPC2002 eMbedded Visual Tools 3.0
WinCE4, WM2003/SE eMbedded Visual C++ 4.0 (SP3 required for WM2003), Visual Studio 2005
WinCE5, WM5 eMbedded Visual C++ 4.0 SP4, Visual Studio 2005 preferable

.NET Compact Framework 1.0 Visual Studio 2003, Visual Studio 2005
.NET Compact Framework 2.0 Visual Studio 2005

Sriram, please correct me if I'm wrong.

sriram_2001
02-26-2006, 09:34 PM
Just a couple of changes

- Wm 2003. You can use VS 2005 for C++
- netCF v1 is supported by Vs 2005