PC Review


Reply
Thread Tools Rate Thread

DLLImport for C lib

 
 
=?Utf-8?B?QmhhcmF0aA==?=
Guest
Posts: n/a
 
      13th Feb 2007
Hello,

I have to call a method written C inside my C# code.This C code is compiled
to .lib .
Do i need to convert this to a dll before using it in my C# code or can I
import the lib file itself.If anybody have idea how to import this in C#
code,it will be a great help to me.Please reply.

Thanks,
Bharath
 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      13th Feb 2007
I found a good blog entry that explains how to do it:

http://geeklit.blogspot.com/2006/08/...ib-from-c.html

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

The shortest distance between 2 points is a curve.

"Bharath" <(E-Mail Removed)> wrote in message
news:E6C5D352-7CA5-4163-85B9-(E-Mail Removed)...
> Hello,
>
> I have to call a method written C inside my C# code.This C code is
> compiled
> to .lib .
> Do i need to convert this to a dll before using it in my C# code or can I
> import the lib file itself.If anybody have idea how to import this in C#
> code,it will be a great help to me.Please reply.
>
> Thanks,
> Bharath



 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      13th Feb 2007
"Bharath" <(E-Mail Removed)> wrote in message
news:E6C5D352-7CA5-4163-85B9-(E-Mail Removed)...
> Hello,
>
> I have to call a method written C inside my C# code.This C code is compiled
> to .lib .
> Do i need to convert this to a dll before using it in my C# code or can I
> import the lib file itself.If anybody have idea how to import this in C#
> code,it will be a great help to me.Please reply.
>
> Thanks,
> Bharath


If you have the code for the lib, just compile it to a DLL, if not you'll have to build a
DLL that thunks into the lib.

Willy.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net and dllimport Larry Microsoft C# .NET 1 7th Oct 2008 08:51 AM
What's the difference of [DllImport ....] with _declspec(dllimport) Ed Microsoft VC .NET 2 31st Jul 2007 02:31 AM
Using DllImport k Microsoft C# .NET 2 8th Feb 2005 11:53 AM
C++ to C# using DllImport t_msreddy Microsoft C# .NET 0 1st Oct 2004 09:01 PM
DllImport into C# Tim Mulholland Microsoft C# .NET 5 20th Feb 2004 09:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:40 PM.