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

.NET c# application call win32 regulare dll api

Hi,

Does anybody know how to call a unmanaged win32 dll function from a .NET C#
managed application? Do I need to write a managed C++ dll or a COM dll
which become a server of .net C# app or I can just 'import' the win32 dll
into my .NET C# application? Where can I get the sample? Thanks a lot for
any help,

CT
Nov 15 '05 #1
2 3588
Chi,

Check out the section of the .NET framework documentation titled
"Platform Invoke Tutorial", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...keTutorial.asp

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Chi Tang" <ch********@hotmail.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anybody know how to call a unmanaged win32 dll function from a .NET C# managed application? Do I need to write a managed C++ dll or a COM dll
which become a server of .net C# app or I can just 'import' the win32 dll
into my .NET C# application? Where can I get the sample? Thanks a lot for any help,

CT

Nov 15 '05 #2
Nicholas,

Appreciate your help. This is exactly what I need. Thanks again,

CT

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Ou**************@TK2MSFTNGP09.phx.gbl...
Chi,

Check out the section of the .NET framework documentation titled
"Platform Invoke Tutorial", located at (watch for line wrap):

http://msdn.microsoft.com/library/de...us/csref/html/
vcwlkPlatformInvokeTutorial.asp
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Chi Tang" <ch********@hotmail.com> wrote in message
news:eL**************@TK2MSFTNGP10.phx.gbl...
Hi,

Does anybody know how to call a unmanaged win32 dll function from a .NET

C#
managed application? Do I need to write a managed C++ dll or a COM dll
which become a server of .net C# app or I can just 'import' the win32 dll into my .NET C# application? Where can I get the sample? Thanks a lot

for
any help,

CT


Nov 15 '05 #3

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

Similar topics

3
by: Adal Chiriliuc | last post by:
Hi. I'm working on a C++ Win32 MFC application and I want to move as much code as possible to Python. At first I wanted to use a Python GUI package and keep the critical components...
5
by: Sonu | last post by:
Hello everyone and thanks in advance. I have a multilingual application which has been built in MFC VC++ 6.0 (non-Unicode). It support English German Hungarian so far, which has been fine. But...
3
by: Gustavo L. Fabro | last post by:
Greetings! I'm testing VS 2005 Beta 2, and I've compiled a program that runs just fine on my computer (where VS is installed). I've tried to run this same program on another computer (after...
5
by: Gaetan | last post by:
I would like to guarantee that only one session at a time can request exclusive access to an object stored in Application. The ownership of the object must last throughout multiple HTTP requests. ...
8
by: TrtnJohn | last post by:
I have an application where I would like to block waiting on an asynchronous event and still process messages. I can implement a hard loop to block such as: Do While StillWaiting...
2
by: Keld R. Hansen | last post by:
I am coding a .NET 2.0 application that needs to be able to run from a network share (intranet), but the security settings does not allow me to do this by default. How can I - in the...
0
by: Pheasant Plucker® | last post by:
Hi there, Not sure if this is the correct ng and I am not a programmer so excuse me but here goes...:-) We have a custom application that has a hook or calls either the Outlook calendar or...
5
by: digory | last post by:
Hi Our product consists of a complex application that is written in C/C++ and uses the old event-based Win32 API (some code has already been in there in times of Windows 3.11!) We cannot afford...
1
by: arunairs | last post by:
Hi, Using the EnterpriseLibrary 4.0, is it possible to Log the method name in the log file. I have it cofigured thus: <loggingConfiguration name="Logging Application Block"...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.