473,769 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1455
On Aug 1, 10:47*am, vivekanandapras a...@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, vivekanandapras a...@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.c omwrote:
On Aug 1, 3:51*pm, vivekanandapras a...@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
1830
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? Is it easy to call any DLL function from .net/C# program? The 2nd question is that on a win32 app, I can use 'UNICODE' to support localization (support different languages). How about on .net? Is it straightforward? On win32 application, I...
11
6600
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 where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
10
2085
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 session and disk. Cheers
0
1737
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 app and moved it to another computer and I get the following error msg when I load the form with the mediaplayer on it. I upgraded this project from a standard vb app to the .net version (vb express anyway) and that is when the problem arose. ...
3
2857
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 additionally pictures of the product are stored in an images subfolder and the database holds the file name of the relevant picture. The user can then click a button to display the picture in a pop-up window and also another button to email the potential...
0
1635
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 is added to the client GAC. My question is how to obtain a correct redistributable package of R10 so that I can automate the delpoyment. Thanks Bill
9
1506
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, Corel, etc actually released any applications that use the framework? Jim
1
3398
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 for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text **************
2
3671
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 this in a VC++.NET Win32 console application. I am very new to using VC++. Can anyone please help? Thanks in anticipation,
3
4295
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 in s/w develepment...I am shobhit Gupta...23 years of age prusuing B.Tech in I.T. Engg. Final Year from Kurukshetra University, Kurukshetra. Recently, i have been working on a project which is to be implemented in a hospital for real life use...Its a...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10211
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7409
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5299
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.