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 - evc++ Dll's

evc++ Dll's

Discuss PocketC for CE (including Desktop Edition)

Postby banffbears on Mon Jul 15, 2002 11:24 am

Are standard DLL's created for EVC++ with
external API calls supported in Pocketc?
banffbears
 
Posts: 5
Joined: Fri Jun 21, 2002 12:08 pm

Postby KOU on Mon Jul 15, 2002 11:51 pm

No.
Somebody have to write wrapper DLL for it.

What is the DLL you want to use?
KOU
 
Posts: 92
Joined: Mon Mar 18, 2002 8:04 pm
Location: USA

Postby banffbears on Mon Jul 15, 2002 11:55 pm

You mean a wrapper for Pocketc specifically?
I have a DLL that exports the functions
already.
banffbears
 
Posts: 5
Joined: Fri Jun 21, 2002 12:08 pm

Postby guy on Tue Jul 16, 2002 7:43 am

Functions exported to PocketC from a DLL have a completely different format to functions exported to evc++.

It is possible to build a DLL that contains both sets of exports. The PocketC exports are called with the parameters in an array of PocketC variables (each variable is a union of all possible PocketC types) and with the return values as a reference to a PocketC variable.

PocketC variables contain both the value of the variable and a type code.

The PocketC functions are called through a single export in the DLL called LibraryCall(). This has a parameter list that comprises a function index number, a reference to the return PocketC variable, the number of arguments and an array of PocketC variables.

From there you use your skill and judgement to unpack the argument list into normal C++ variables, call the appropriate function based on the function index number and then put the returned result back into the PocketC return variable.

PocketC pointers have to be dereferenced through a function in the main PocketC runtime (returning another PocketC variable reference), strings are classes with both an address and length, and structs appear as arrays of PocketC variables where the type code is different for each element of the array.

You have to provide an exported function called LibraryInit() which the PocketC shell calls to pass the address of the pointer dereferencing functions (and in which you can do your own one time init stuff), and LibraryFree() which PocketC calls at rundown.

I have a library (CEAPI) which PocketC programs use to access native CE API functions. This comprises a set of PocketC compatible exports that just convert parameters, call the appropriate real API function and then return the result. Many of the entry points comprise one line of code. The rest have various levels of tedious struct conversion and string conversion messing around on either side of the function call.

In the PocketC knowledge base section of this board there is a post from Kevin Cao containing information about building PocketC visible function entry points into DLLs. You can download my file with the commented source of the main entry point to the CEAPI interface DLL from:

http://www.networkdynamics.net/pcktdll.zip

The comments should save you from the detective work that is required in order to understand some of Kevin's rather cryptic documemntation.

This also contains an update to Kevin's stdafx.h with some updates to support my use in the CEAPI dll (most useful just being a set of simple macros to save typing when reading real values out of PocketC variables. And ceplatform.h, a file recommended to me by Kevin that defines the libraries required by each CE platfrom so that you don't have to keep reconfiguring evc all the time.


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 Tue Jul 16, 2002 10:10 am

The original article from Kevin is at:

http://pocketc.net/forum/topic.asp?TOPIC_ID=125&FORUM_ID=7&CAT_ID=4&Topic_Title=%28Advanced%29+Extend+PocketC+API+using+DLLs&Forum_Title=PocketC+on+Windows+CE+OS

Ignore what he says about needing STL for CE.

Pairing the word "documemntation" with the word cryptic was probably a bad idea. "documentation" is probably a better word to use.

PocketC functions return a value, not values.

These corrections brought to you here because editing big posts tends to get them truncated on this web board.



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 banffbears on Tue Jul 16, 2002 11:39 am

Hi Guy:

From the little I know about PocketC, looks
like this is too much much work for me.
Maybe someone out there would be interested
in converting a DLL for MPort MIDI hardware
use on the Pocketpc's for Pocketc?
banffbears
 
Posts: 5
Joined: Fri Jun 21, 2002 12:08 pm

Postby KOU on Tue Jul 16, 2002 4:50 pm

I might include it in PocketC MidiPP(Software midi library) DLL wrapper.
But its development is currently paused due to unknown shut down of PocketC when debugging.
Can you give me a address of that DLL or the source code?
KOU
 
Posts: 92
Joined: Mon Mar 18, 2002 8:04 pm
Location: USA

Postby banffbears on Tue Jul 16, 2002 5:03 pm

Email me direct at bobkatt@ica.net and we can discuss this further.

Thanks
banffbears
 
Posts: 5
Joined: Fri Jun 21, 2002 12:08 pm

Postby guy on Tue Dec 17, 2002 2:14 pm

A rather late response to this message, but the answer may be useful to other people.

It's now possible to call code in <b>any</b> DLL directly from PocketC by using a function in the CEAPI library.

The function CEAPI_stdcall() takes as parameters the address to call and the address of a PocketC struct containing the parameters to pass to the function.

All you have to do is call LoadLibrary() to load your DLL, then GetProcAddress() to get the addresses of the functions that you want to call.

CEAPI_stdcall() takes four parameters:

lpfnFunction - The address of the function to call
iType - The type of return value. Usually vtInt
iArgCount - The number of argumants to pass
pArgList - The address of a PocketC struct containing the argument list

You can call both stdcall and cdecl type functions using CEAPI_stdcall, the stack is cleaned correctly for both.

To keep your code clear, you can use the macro CEAPI_cdecl() to call cdecl type functions. It is defined to be the same as CEAPI_stdcall.

You can even write your code in assembler and load it into memory yourself before calling it if you want. There's an example posted in the Yahoo 568asm (HP Jornada 568 assembler) group that does exactly this.

Providing you apply the correct "name mangling" (and hidden parameter) rules you can even call object member functions using this function.



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 Wed Dec 18, 2002 1:36 pm

Might I say... Way darned cool!

<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 />A rather late response to this message, but the answer may be useful to other people.

It's now possible to call code in <b>any</b> DLL directly from PocketC by using a function in the CEAPI library.

[snip]
You can even write your code in assembler and load it into memory yourself before calling it if you want. There's an example posted in the Yahoo 568asm (HP Jornada 568 assembler) group that does exactly this.

Providing you apply the correct "name mangling" (and hidden parameter) rules you can even call object member functions using this function.

Guy

<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


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron