Forum > Windows CE

How to use C library?

(1/1)

ertank:
Hi,

I have a WinCE device and an ARMV4 SDK for that device. However, I am provided a C library and header files only. I have not enough C knowledge to make a wrapper DLL for that library.

Is there a way for me to be able to use it in my EXE? Or, is it possible to make a wrapper DLL with some basic instructions?

Thanks.

Leledumbo:

--- Quote from: ertank on April 08, 2016, 05:43:13 pm ---Is there a way for me to be able to use it in my EXE? Or, is it possible to make a wrapper DLL with some basic instructions?

--- End quote ---
Yes, learn how to make the wrapper. It's no way basic, but not complex nor advanced either. I suggest not to use h2pas in the first place, but learn how to read C instead. Only after that you can use h2pas. There's no guarantee that h2pas can generate directly usable wrapper, some things are just too hard to create a wrapper for automatically. In fact, there are already cases where initially written by h2pas wrapper is totally rewritten by hand.

Thaddy:

--- Quote from: Leledumbo on April 09, 2016, 05:40:05 am --- In fact, there are already cases where initially written by h2pas wrapper is totally rewritten by hand.

--- End quote ---

That's mostly because such a user has no clue where its for and how it works.
Rule number one is to first run a c preprossesor to expand any C macro's to actual plain C and only after that run h2pas and h2paspp.
Running the C preprocessor means also pulling in all C header files except maybe the standard ones.
After that I almost always have excellent results with h2pas.

Notable crime that doesn't work: K&R style parameters with type only, like (int,int,long void*) // valid C but....


AAlso note all but some wince standard headers are already translated, of course.

Navigation

[0] Message Index

Go to full version