I was actually thinking of writing the code into an executable and then
calling the functions from there, but again, I have to make multiple writes
to the emulated "ports" and then get a final write of data. I can only put
command line arguments in. I can't really think of a way, perhaps writing it
as a COM?
"ccurrens" wrote:
> So, I am writing an application in C#, and I have some old C code that I want
> to use. Now, i tried to convert it to a DLL, and while I easily got it
> working, it didn't work like it was supposed to. The problem, is that there
> are global structures, with values that change as you write to certain
> functions.
>
> To be less vague, the C code is an old FM Chip emulator, so most of the
> structures' values have to be stored in memory, as I make calls to change
> them. Then I render the sound wave, based on the structure's values, with
> another function call. The DLL idea didn't work, because it's making
> seperate calls to the functions, and all data used is reset each call.
>
> So, with DLLs out of the question, I'm asking for people's opinions on what
> would be the best way to use the code in C#. I was considering converting it
> to managed C, and using multiple file assemblies, but I'm unsure if it would
> keep the data in memory between calls.
>
> Any ideas are appreciated.
>
> Thanks
>
|