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 - (Advanced) Extend PocketC API using DLLs

(Advanced) Extend PocketC API using DLLs

Postby Admin on Sun Jan 14, 2001 6:29 pm

Introduction:
-----------------------------------------
PocketC Default APIs are designed for the general users. Overtime, specialized developers
wants additional features to be added. There was no good way to communicated with the
native APIs in PocketC 2.0. In the PocketC 3.0, I am going to introduce a way to talk
with the native APIs, and extending the default APIs with your own.

Purpose:
-----------------------------------------
1. Optimize certain routines.
For example: If you are not satisfied with the default graphic routines provided, you
can now write your own in C++, and wrap it in a DLL. The DLL exports certain APIs that
can be called directly from PocketC applications.

2. Missing functions from the default API.
For example: you wish there is a set of API for sprite graphics, and have experience with
these code in C++. You can wrap the sprite code into a DLL, and provide a sprite engine
for the PocketC users.

Requirement:
-----------------------------------------
Microsoft Embedded Visual C++ 3.0
Microsoft Windows NT/2000
Standard Template Library for CE
Download http://users.iol.it/g.govi/index_en.html
OrbWorks PocketC Desktop Edition Or PocketC Device Edition 3.0

Approach:
-----------------------------------------
I have created an example dll with project/source files to demonstrate how the DLL can be
written. You can take the example project, and expand it for your own project.

In this dll, you will find out how to export a function in C++, how to define a function
in C++, and how to get the arguments, and return value from your function.
After the funtions are defined, you will need to create a header file for PocketC compiler
to understand the set of APIs you just created in this external dll.

Files:
-----------------------------------------
DemoDLL:
DemoDll.vcp -- project file
DemoDll.def -- define LoadLibrary (don't modify)
ustring.h -- string class header (don't modify)
stdafx.cpp -- debugging routines (don't modify)
stackentry.h-- argument class header (don't modify)
pktlibrary.h-- common dll headers (don't modify)

demo.Dll.cpp-- define/export functions (modify)
1. Make sure your function is in the enum
2. Make sure FUNC_DEFINE, FUNC_ASSIGN, FUNC_DECLARE are added for your function.
Read their definition if you are interested.
3. Make sure you remember to add the function export prototype for PocketC compiler to use.
syntax: #export dllname(funcid) function prototype;

Utildlib:
To simplify the process, I bundled the extra code
into a static lib. Make sure link with this lib during the build.

demodll.h
This file tells the pocketc compiler that the exported functions from
the demodll. Please include this .h file if you plan to call APIs from
demodll.dll

test_demodll.pc
This test file calls the APIs we created in the dll.

test_demodll.app
Compiled test application. You should be able to compile this app file
from your device or desktop PocketC compiler.

Download http://pocketc.net/release/30/externdll.zip

Support:
-----------------------------------------
contact cao@orbworks.com for questions about how to make the DLL.
Admin
 
Posts: 86
Joined: Fri Oct 06, 2000 6:00 am
Location: USA

Return to PocketC for CE KB

Who is online

Users browsing this forum: No registered users and 2 guests

cron