NO

Author Topic: Console applications for Pocket PC?  (Read 8489 times)

Juergen

  • Guest
Console applications for Pocket PC?
« on: April 06, 2005, 02:01:57 PM »
Hello,

first of all, thanks a lot for Pelles C. It's very impressive! I'm looking for a way to program the Pocket PC as simple as possible.

I don't know much about C, and in general I don't consider C simple, but Pelles C looks so clean and versatile, that I might start to learn C, so that I can use Pelles C to write programs for my Pocket PC.
(Currently I write programs in Euphoria, which provides a cool "Euphoria to C translator", that -- besides other compilers -- supports LCC. On the Euphoria mailing list it has already been suggested, that the translator also should support Pelles C. That would be cool for people like me, of course!)

However, there is another issue. Windows GUI programming itself is not sooooo easy, and often I only need a console program. Pocket PC has no text console by nature, but luckily, PocketConsole 1.3 adds this and is freely available.

So my question is: Is it possible to write console applications for Pocket PC with Pelles C? If so, how? I would appreciate it very much, if you could provide a "Hello world" for Pocket PC console demo program. That would be a perfect starting point for me.
If it's not possible currently, maybe you can add this option in a future release? :)

Thanks again,
Juergen

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Console applications for Pocket PC?
« Reply #1 on: April 08, 2005, 01:27:03 PM »
Quote from: "Juergen"
first of all, thanks a lot for Pelles C. It's very impressive! I'm looking for a way to program the Pocket PC as simple as possible.

Thanks!

Quote from: "Juergen"

On the Euphoria mailing list it has already been suggested, that the translator also should support Pelles C. That would be cool for people like me, of course!)

Yep, that would be cool...

Quote from: "Juergen"

However, there is another issue. Windows GUI programming itself is not sooooo easy, and often I only need a console program.

No, not so easy ( on the other hand, compared to 16-bit Windows, Win32 is like a dream... ;) ). You need to understand the "event driven" approach in Windows, compared to the more sequential approach in console mode programs.

Quote from: "Juergen"

So my question is: Is it possible to write console applications for Pocket PC with Pelles C? If so, how?

Maybe. I havn't looked at the program you mentioned. I will look at it, and get back...

Pelle
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Console applications for Pocket PC?
« Reply #2 on: April 08, 2005, 02:37:02 PM »
Hello again,

Attached is the smallest possible sample: "Hello, world". You need to install the console driver on your device (pocketconsole_arm_setup.exe) and the SDK on your desktop computer (PortSDK.msi).

The changes I made for a normal Pocket PC project (Project -> Project options) was on the Linker tab (portlib.lib + entry point) and the Folders tab (path's to PortSDK).

I'm sure you can fill in the rest... ;-)

Pelle
/Pelle

Juergen

  • Guest
Console applications for Pocket PC?
« Reply #3 on: April 11, 2005, 10:01:24 AM »
Hello Pelle,

thank you!!
Your sample program 'ConPPC.exe' runs fine on my Pocket PC.

However, currently I'm not able to build a console program for Pocket PC myself.
I have installed PortSDK.msi on my desktop computer. I've copied your sample project to a subdirectory 'PellesC\Projects\ConPPC\', opened it in Pelles C IDE, and in "Project -> Project options" on the "Folders" tab I modified the paths for Libraries and Includes according to the respective names on my desktop PC (except that I have no subdirectory "PellesC\Lib\Win\gl" -- am I supposed to create manually an empty directory with this name?). When I choose "Project -> Build ConPPc.exe", the IDE always crashes. The error message (translated to English) is:

-----------------------------------------------------------------------------
Poide
-----------------------------------------------------------------------------
This application will be closed because of an invalid process.
If this problem will not disappear, contact the manufacturer.
-----------------------------------------------------------------------------
POIDE caused an error by an invalid page in module KERNEL32.DLL
at 0167:bff7a388.
Registers:
[blah blah]
-----------------------------------------------------------------------------

In the documentation of PortSDK it reads in the section 'Requirements': "Microsoft Windows Platform SDK for Pocket PC or Pocket PC 2002". Is this actually also required in conjunction with PellesC?
I have not installed this currently, and on http://www.microsoft.com/downloads/details.aspx?FamilyID=2dbee84a-bd94-4167-b817-2b2e548b2e92&displaylang=en it reads: "Supported Operating Systems: Windows 2000, Windows XP". I'm running Windows 98, that means the MS Windows Platform SDK for Pocket PC will not run on my PC ...

What can I do?

Regards, Juergen

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Console applications for Pocket PC?
« Reply #4 on: April 11, 2005, 11:08:42 AM »
Quote from: "Juergen"
...(except that I have no subdirectory "PellesC\Lib\Win\gl" -- am I supposed to create manually an empty directory with this name?)...

You don't need it - just remove this path. It must be from a test on my machine.

Quote from: "Juergen"

When I choose "Project -> Build ConPPc.exe", the IDE always crashes. The error message (translated to English) is:
...
POIDE caused an error by an invalid page in module KERNEL32.DLL
at 0167:bff7a388.
Registers:
[blah blah]

This is no good - the IDE shouldn't crash. The address by itself doesn't give me that many clues. Are you using/can you use something like "DrWatson" (if I can get a stack trace, with an address pointing into POIDE.EXE, it would be much easier to find the problem).

Quote from: "Juergen"

In the documentation of PortSDK it reads in the section 'Requirements': "Microsoft Windows Platform SDK for Pocket PC or Pocket PC 2002". Is this actually also required in conjunction with PellesC?

No, this shouldn't be necessary. The documentation might be useful, but otherwise not.

Quote from: "Juergen"

What can I do?

A crash during a build is not normal. I will see what I can find out, but any additional information you can give me will be helpful:
...more info on the actual crash...
...do you have general problems with this machine, or just Pelles C?
...

Pelle
/Pelle

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Console applications for Pocket PC?
« Reply #5 on: April 11, 2005, 01:20:19 PM »
OK, I managed to start my old Win 98 machine and do some testing. It looks like a problem with project folder settings on Win 9X (works on Win NT). This is a new feature in 3.00. Obviously no one (including me) have tested this on anything but Win NT/2K/XP.

Do like this for now, and it *should* work:
1. Choose Project options, Folders tab, click on the "Default" button at the bottom of the page, and the OK. This will remove the extra folders.
2. Choose Tools -> Options, Folders tab, and add the additional folders here instead (for PocketConsole). This will be settings for all projects, but it might not be such a bad thing in your case...

Pelle
/Pelle

Juergen

  • Guest
Console applications for Pocket PC?
« Reply #6 on: April 11, 2005, 07:09:54 PM »
Apparently Sherlock Holmes is on this forum, so why do we need Dr. Watson? :) It works like a charm now!!! :D

FYI: Under "Project options", the list of default folders includes "PellesC\Lib\Win\gl". When I keep this entry, everything works OK, although this folder doesn't exist on my PC. When I delete this entry from the "Folders" list under "Project options", then the IDE crashes again when I try to build the program.

However, now I know how to do it, and in contrast to M$ you make it possible to write programs for Pocket PC on Windows 98 -- both GUI and console applications. Great!!

Thanks a lot for all your efforts! =D>
Regards, Juergen

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Console applications for Pocket PC?
« Reply #7 on: April 11, 2005, 07:43:07 PM »
Quote from: "Juergen"
Apparently Sherlock Holmes is on this forum, so why do we need Dr. Watson? :) It works like a charm now!!! :D

To document the story...? :-)
OK, great that it works.

Quote from: "Juergen"

FYI: Under "Project options", the list of default folders includes "PellesC\Lib\Win\gl". When I keep this entry, everything works OK, although this folder doesn't exist on my PC. When I delete this entry from the "Folders" list under "Project options", then the IDE crashes again when I try to build the program.

OK, thanks for the info. This might help.

Quote from: "Juergen"

However, now I know how to do it, and in contrast to M$ you make it possible to write programs for Pocket PC on Windows 98 -- both GUI and console applications. Great!!

Very good. I need to do some more research about the problem, but it should be fixed in the next release...

Quote from: "Juergen"

Thanks a lot for all your efforts! =D>

Thanks! :-)

Pelle
/Pelle