The Q/A at link text gets very close to what I'm looking for, but I'm just starting on C# and need a bit more filled in and possibly some hints about the best way to proceed.
I've got an app I've written for the PalmPre/webOS in Javascript and a piece of it is written in C for portability, not for performance. It does Lear Jet performance calculations.
In the webOS world, the C code (plugin) goes in its own process and there's a way for JS to invoke and invoke the C code (using 'main') to start the process and C can register entry points. Then JS can call an entrypoint with some arguments, the C code does a calculation, and then C returns a pointer to a string of digits to JS for display. The C code has no graphics, no dynamic memory allocation, etc. I'd like to essentially convert the JS GUI code into C#, and use the C code with minor tweaks (#if's) for C# to do the same thing that JS on the Pre does now.
Answer 1/option2 I think is best, but I didn't understand what he meant by "your project vs consumer project" and how/why that means one is a dllimport and one is a dllexport, and I don't have a DLL, I have just C code routines. It looks like all I'd have to do is replace his 'PublicFunc' with my C routine, right? And I could have a number of args where it says 'params'? However there's no return type specified, how would I return an answer to C#? Is 'returntype' a reserved word? Or an example place-holder? Or am I off the track because I don't have a DLL? BTW, the C code does have a mode to compile to run stand-alone as a DOS program for testing.
Is there any simple example code someplace which illustrates how to do this? I'm downloading the MS VS 2010 Express now, haven't installed it yet. Perhaps there's something there?
TIA!