Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Examples Question

Examples Question

Discuss PocketC for CE (including Desktop Edition)

Postby corwyn on Thu Nov 21, 2002 4:33 am

I just got the desktop version of PocketC. I am running through the examples since the documentation is... well 'spartan' is the nicest thing I can say...

I just tried to compile the basicevent example and it will not compile. Has anyone else had success with this? My first reaction is that I am hitting some bug in the compiler. It is claiming WS_CHILD is not defined. I moved the define right next to the usage and the compile got past that but failed in the same way later on for different declared item.

Any comments?

----------------------------------------------------------
http://www.kolvir.com/ <- Ever Evolving!
Don Glover, the younger "Wild Thing"
C, Visual Basic Programmer: Have Network Will Program.
----------------------------------------------------------
http://www.kolvir.com/ <- Ever Evolving!
Don Glover, the younger "Wild Thing"
C, Visual Basic Programmer: Have Network Will Program.
corwyn
 
Posts: 11
Joined: Thu Nov 21, 2002 4:02 am
Location: USA

Postby guy on Thu Nov 21, 2002 6:09 am

Have you #included pcheader.h at the top of your program?


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby corwyn on Thu Nov 21, 2002 11:36 am

Just to clarify, the item I am trying to compile is basicevent.pc which is an example provided with the compiler. it is in the examples/bassicevent folder. (ie it is not my program, it is one I would expect to compile and work out of the box) I just checked and yes the people who provided the example did include the header.

The item is question is not defined in the header, it is defined in the example code itself.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by guy</i>
<br />Have you #included pcheader.h at the top of your program?


Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum

<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

----------------------------------------------------------
http://www.kolvir.com/ <- Ever Evolving!
Don Glover, the younger "Wild Thing"
C, Visual Basic Programmer: Have Network Will Program.
----------------------------------------------------------
http://www.kolvir.com/ <- Ever Evolving!
Don Glover, the younger "Wild Thing"
C, Visual Basic Programmer: Have Network Will Program.
corwyn
 
Posts: 11
Joined: Thu Nov 21, 2002 4:02 am
Location: USA

Postby guy on Thu Nov 21, 2002 1:23 pm

I just tried to compile that one as well. My compilation fell over because the function getwndid() doesn't exist.

It may well exist in a version of the runtime library that hasn't been released.

I suspect that the function would be doing GetWindowLong(hwnd, GWL_ID) if it existed.

I looked at the code in basicevent.pc. I had to sit down quietly for a while until I felt better but I'm OK now. Interesting use of tabs and spaces, and it's nice to see an indentation style that doesn't mimic anybody else's. Indenting to match the control level of the code is so old hat nowadays.

Strangely basicevent.pc doesn't use the basic event functions. It uses the odd half-way eventmsg function that tries to return nearly a whole MSG struct.

If you want to make the rather odd basicevent program work then you need to get the free CE API library addon for PocketC (see below in sig) and replace the getwndid() function with a call to GetWindowLong() instead.

If you want more of the documentation then you can find it hidden on the OrbWorks site here:

http://www.orbworks.com/wince/doc/index.html

If you're new to windows event processing then I recommend that you use the PocketC event(), guiid() getnotify() functions to get events and identify them, and the key(), penx() and peny() functions to get the event parameters.

You could download the free evaluation version of PCForm (link in sig below) and get it to write a program for you then look at the code it generates. The evaluation version is a bit old now and you need to look at the notes on the PCForm site.

If you're <b>not</b> new to windows event processing then I recommend that you get the CE API library for PocketC and use the GetMessage() and DispatchMessage() functions with a real MSG struct.

You could also look at the program winapp.pc in the latest CE API developer download. This shows you how to use GetMessage() and DispatchMessage() from PocketC.

If you're unfamiliar with using the WIN32 API on Windows CE, the programmer documentation is at:

http://msdn.microsoft.com/library/en-us/wceintro/htm/cestart.asp

Simple basic event processing:

<pre id="code"><font face="courier" size="2" id="code">


main() {


int iEvent ; // PocketC event code
int iId ; // ID of control that event relates to

// Create a few controls here
//
// createctrl(...)


while (1) {


sleep(0) ; // Don't hog CPU and battery
iEvent = event(1) ; // Wait for the next event
iId = guiid() ; // Get the thing it refers to


ProcessEvent(iEvent, iId) ; // Go and handle the event
}
}

ProcessEvent(iEvent, iId) {


// Do processing based on the event and the thing it refers to.


}


</font id="code"></pre id="code">

Do not expect the examples supplied with the compiler to work. Don't even expect the compiler supplied with the compiler to work.



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby guy on Thu Nov 21, 2002 1:30 pm

To be slightly serious though. Despite the odd compiler bug, sparse documentation and the lack of support since Kevin started working on OrbForms, PocketC is a nice language and does let you hack together programs very easily.

You can get a lot of support through this forum.



Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby corwyn on Thu Nov 21, 2002 2:20 pm

Thanks. Your code snippet actually tells me most of what I wanted to know. Now I will try hack out a test program for myself and see what I can get to work ...
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by guy</i>
[snip]
Do not expect the examples supplied with the compiler to work. Don't even expect the compiler supplied with the compiler to work.
[snip]
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">

Having been at this kind of stuff for 29 years now I am quite familiar with the syndrome. I have had to work around my fair (or unfair, depending on how you look at it) share of creaky software over the years. I decided to go with pocketc despite its .... limitations... since it looked to be the quickest way to bang out apps that would have limited use.

----------------------------------------------------------
http://www.kolvir.com/ <- Ever Evolving!
Don Glover, the younger "Wild Thing"
C, Visual Basic Programmer: Have Network Will Program.
----------------------------------------------------------
http://www.kolvir.com/ <- Ever Evolving!
Don Glover, the younger "Wild Thing"
C, Visual Basic Programmer: Have Network Will Program.
corwyn
 
Posts: 11
Joined: Thu Nov 21, 2002 4:02 am
Location: USA


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron