Lib Wrapper

  • Thread starter Thread starter RF
  • Start date Start date
R

RF

Hi All,

I have a "lib" file and I need to create a wrapper to expose some methods.
How can I do this in C#.

Can I use [DllImport] to expose methods from this lib? Which folder does the
lib file need to stored in order for C# to call unmananged methods.

For Example:

[DllImport("abc.lib",
EntryPoint="apiFunc1",CallingConvention=CallingConvention.Cdecl)]
public static extern Int32 apiFunc1(args);

Will this work? Any help is appreciated.

Thanks,

RF
 
Can I use [DllImport] to expose methods from this lib? Which folder does the
lib file need to stored in order for C# to call unmananged methods.

Not directly no. You must first link it into a DLL and export the
functionality you want to use.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top