LADSoft / OrangeC

OrangeC Compiler And Tool Chain
http://ladsoft.tripod.com/orange_c_compiler.html
Other
284 stars 39 forks source link

Question: Is it possible to use native DLL with OCCIL? #968

Closed ghost closed 5 months ago

ghost commented 8 months ago

I raised this question because unlike normal OCC, OCCIL targets .NET Framework, not native code.

LADSoft commented 8 months ago

yes you can. You would just use a standard C header to define the functions and list the DLL on the command line with the -L switch.

For example to get access to the MessageBox function you would include windows.h as normal, then use something like:

occil -Luser32 myprog.c

and occil will know to create a .net program that has code to invoke the MessageBox function out of user32.dll

there are example programs with occil in the directory \orangec\tests\occil and related subdirectories. These get run every time we do a build on either appveyor or github actions.... some of them showcase the ability to compile substantially large C programs with occil, without modification.

GitMensch commented 5 months ago

question solved - please close