[Mono-list] Anyone suggest a clean way to do the following in Mono..??

Robert Jordan robertj at gmx.net
Tue Jul 22 11:36:15 EDT 2008


Andrew Tierney wrote:
> Hi All,
> 
> Anyone suggest a clean solution to the following ??
> 
> I would like to wrap WinPCap and LibpCap and at runtime select the right 
> one to call based on Platform. (Win/Linux)
> 
> Initially I thought about 2 classes, and an interface to define a contract..
> 
> Then I ran into the problem of DLLImport/static and Interfaces... (oh 
> and one routine uses a delegate callback for an argument).
> 
> I don't really want to duplicate the wrapper routines for both 
> platforms. And GetprocAddr/Delegate seems a little messy..

If the libs share the same API, you can map between them
using mono's dllmap mechanism.

See man mono-config.

Robert



More information about the Mono-list mailing list