Re: automatic dll wrapping
- Posted by David Cuny <dcuny at LANSET.COM> Apr 15, 2001
- 368 views
Tone Skoda wrote: > I was thinking that it could be possible to make > a program which would automatically wrap a dll. Yes, this can be done. at one point, I had written module for SWIG (Simple Wrapper Interface Generator) that would automatically generate DLLs for C and C++ modules. It wasn't very good at handling custom datatypes, though - it treated them all as pointers. A better approach than trying to be able to parse any C/C++ file would to simplify the grammar that the program accepted. For example, you could restrict it to only being able to read function prototypes, and simple structs. It's a lot easier to clean up the code by hand than it is to make the code smarter, and the result it the same. It's a lot easier to maintain the code, too. I had written another wrapper generator along the lines that I just described, but I seem to have misplaced it. I'll have to dig it up, because even thought it was incomplete, it did a nice job of wrapping inherited C++ methods... -- David Cuny