473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# Problem (compatible with C++)

Hi All,

I am a newbie in C#.

I have a several question want to throw out.

1) How can I include a C/C++ library into C# ? any samples?
2) If I have *.LIB library file (from C/C++), how can I use it on C#?
3) I wrote some C/C++ customized functions and save it on CPP
file(*.cpp) , how can I reuse it on C#?

Please help.
Thank you very much.
Nov 16 '05 #1
1 1931
Inline ***

Willy.

"alan" <ch***********@i-cable.com> wrote in message
news:7b**************************@posting.google.c om...
Hi All,

I am a newbie in C#.

I have a several question want to throw out.

1) How can I include a C/C++ library into C# ? any samples? *** You can't include a C/C++ library in C#, at best you can call exported C
style functions (assuming your library is effectively a DLL) using PInvoke
interop.
2) If I have *.LIB library file (from C/C++), how can I use it on C#? *** You can't, LIB can only be statically linked, one option is to build a
dll from your lib, another is to wrap your calls to your lib functions in a
DLL and export the wrappers.
3) I wrote some C/C++ customized functions and save it on CPP
file(*.cpp) , how can I reuse it on C#?
*** You can't. C# is not C/C++ you can't mix both on source level.
What you can do is:
- build a DLL from your C/C++ code and export the functions.
- or use Managed C++ to build managed code wrappers for your unmanaged C/C++
code.

Please help.
Thank you very much.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: R. Rajesh Jeba Anbiah | last post by:
Kinda OT. I haven't yet moved to PHP5. But, interested to know how many of you _really_ started using it or moved? Are you doing any compatible tweaks specifically for PHP 5 (forward compatible) or...
1
by: dkomo | last post by:
I wrote a VB 6.0 program to create an Access database file and fill it with data. I used the following DAO statement: Set db_AllEquity = ws.CreateDatabase(Database_Name, dbLangGeneral,...
5
by: Leif K-Brooks | last post by:
I need to do some simple image editing (pretty much just scaling) in a GPLed program. Unfortunatly, both of the Python libraries for image editing that I found (gdmodule and PIL) are under the...
0
by: Lee Gillie | last post by:
We have systems built upon shared libraries, which are maintained by a group of programmers. We install these to the GAC on production servers. For saftey, when a programmer uses one of these...
9
by: bert76 | last post by:
can anyone suggest a couple of websites providing *compatible* javascript? of course there is http://javascript.internet.com/ http://javascriptkit.com/ and the likes, but time and again you have...
11
by: Kristoffer Arfvidson | last post by:
HI! I have a question.... when designing asp.net pages in vs.net I always see that labels are transformed to <span tags... I stopped using span and div before because of its lack of compatibility...
5
by: max | last post by:
Dear all, I did the following analysis to conclude that the following pointer types are not compatible. Please let me know If my analysis and interpretation of the C standard are correct: ...
5
by: P | last post by:
I was wondering what sort of changes I need to make in order to make an application to be DEP compatible with on Windows XP x64 version 2003. I have compiled an open source C application...
2
by: gordon | last post by:
hi in my application a file selection by user returns a pathname string like F:/images/png/my.png or F:/docs/text/somedoc.txt ....etc. I can get the extension using...
1
by: Nathan Sokalski | last post by:
On Microsoft's page about IE8 and Defining Document Compatibility at: http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx They give the following code to add to Web.config: <?xml...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.