473,405 Members | 2,167 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,405 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 1935
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.