473,385 Members | 1,606 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,385 software developers and data experts.

Using a win32 application in c#

hi,

I am entirely new to the C#. Now I have a win32 application (this is a
win32 library not a DLL) which I want to use in a C# application.
Can any one please let me know how I can use this win32 library in my
C# application. May be in a step by step
procedure...........................:)

Actually can any one explain in words but in a step by step how I can
achieve that
Aug 1 '08 #1
4 1428
On Aug 1, 10:47*am, vivekanandaprasa...@gmail.com wrote:
hi,

I am entirely new to the C#. Now I have a win32 application (this is a
win32 library not a DLL) which I want to use in a C# application.
Can any one please let me know how I can use this win32 library in my
C# application. May be in a step by step
procedure...........................:)

Actually can any one explain in words but in a step by step how I can
achieve that
You cannot use a static C++ library in a C# application directly. But
you have two workarounds:

1) Link that static library into an unmanaged DLL, and use that via P/
Invoke
2) Use C++/CLI to wrap all functions in the static library into
managed class methods, and use that normally via C#
Aug 1 '08 #2
Thanks for the help.........

But if you dont mind can u just please let me know how to link my
static library to an unmanaged DLL. I know how to invoke that using
the P/Inoke. The entire problem is how to link my static library to an
unmanaged DLL
Aug 1 '08 #3
On Aug 1, 3:51*pm, vivekanandaprasa...@gmail.com wrote:
But if you dont mind can u just please let me know how to link my
static library to an unmanaged DLL. I know how to invoke that using
the P/Inoke. The entire problem is how to link my static library to an
unmanaged DLL
Let's say you have a library, foo.lib, which contains a global
function called Foo. You can build a DLL out of it like this:

link foo.lib /out:foo_dll.dll /dll /export:Foo

If you have many functions that you want to export, you might want to
write a .def file instead of using /export. Read here for more details
on this:

http://msdn.microsoft.com/en-us/library/28d6s79h.aspx
Aug 1 '08 #4
On Aug 1, 5:36*pm, Pavel Minaev <int...@gmail.comwrote:
On Aug 1, 3:51*pm, vivekanandaprasa...@gmail.com wrote:
But if you dont mind can u just please let me know how to link my
static library to an unmanaged DLL. I know how to invoke that using
the P/Inoke. The entire problem is how to link my static library to an
unmanaged DLL

Let's say you have a library, foo.lib, which contains a global
function called Foo. You can build a DLL out of it like this:

* link *foo.lib */out:foo_dll.dll */dll */export:Foo

If you have many functions that you want to export, you might want to
write a .def file instead of using /export. Read here for more details
on this:

http://msdn.microsoft.com/en-us/library/28d6s79h.aspx
thanks for the reply
Aug 5 '08 #5

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

Similar topics

5
by: Chi Tang | last post by:
Hi, I need to implement a stand alone gui application which need to call some other regular DLL functions (unmanaged code). Should I use .net with C# or just use Win32 API to write this exe? ...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
10
by: Bob | last post by:
Hi there, Can anyone point me to anything relating to using XP's built-in CD writing support from VB.Net... or even C#, or classic VB...? I just want to write files to the CD and finalise the...
0
by: Nonee | last post by:
Hello- I have a form with the mediaplayer referenced to play mp3's and avi's and I believe that is what is causing the problem. I am not sure, but I am hoping. Anyway, I "published" the vb.net...
3
by: Siv | last post by:
Hi, A little while ago I wrote a small program that allowed the user to view products from a database. The database holds the details of the products which can be viewed via a form and...
0
by: Bill Nguyen | last post by:
I ran into this error using ClickOne to deploy a .NET 2.0 app. CrystalReports for .NET 2.0 is included in the delployment. The error indicates that an incorrect version of CrystalReports.Engine DLL...
9
by: Jim | last post by:
With .net having been around for a while now, does anyone know what the uptake of major software houses is in using .net for Windows Application development? e.g. have the likes of Adobe, MS,...
1
by: bmaheswar | last post by:
Hi, I have a windows service. it is developed using .Net Framework 1.0. When i try to run that service using CLR PRofile 1.0. Profiler Throws error as show below. See the end of this message...
2
by: SheetalGandhi24 | last post by:
Hi I need to use the System.IO namespace in the Win32 console application. Any clues for doing the same? Basically, I need to load the files of a particular folder in an array. I need to do...
3
by: shobhitguptait | last post by:
How to Run C#.NET Windows App on N/W with centralized DB using SQL SERVER 2000 Hello All...i m really grate full to c such a website where developers try to help people like us who face problems...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.