473,385 Members | 1,757 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 third party DLL

I'd like to talk to a (serial port linked) external instrument from
within a .Net project. The makers supply a Win32 compatible DLL
(written in C and not an ActiveX DLL I think) that handles the low
level communication to and from the instrument. So by using the
available DLL, hopefully I can achieve what I need to. Trouble is that
I'm not familiar with working with third party DLLs from within .Net.
But I have documentation summarising the behaviour of the DLL so
fingers crossed it won't be too difficult.

I know that no-one here can advise me in detail on using this
particular DLL, but is it possible to offer any generic guidance on
how to get this going or maybe suggest any web links that might deal
with this topic in outline?

Many thanks if anyone can help.
John Dann
Nov 20 '05 #1
3 2113
What you're looking for is called P/Invoke (P for "Platform").

(The information below may be c#/vb.net mixed. In fact, most of the
documentation/samples on PInvoke I've found is in c#)

http://msdn.microsoft.com/msdnmag/is...T/default.aspx

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

http://msdn.microsoft.com/msdnmag/is...netserialcomm/

http://www.codeguru.com/net_general/PInvoke.html

http://www.ondotnet.com/pub/a/dotnet...ominterop.html
"John Dann" <ne**@prodata.co.uk> wrote in message
news:i3********************************@4ax.com...
I'd like to talk to a (serial port linked) external instrument from
within a .Net project. The makers supply a Win32 compatible DLL
(written in C and not an ActiveX DLL I think) that handles the low
level communication to and from the instrument. So by using the
available DLL, hopefully I can achieve what I need to. Trouble is that
I'm not familiar with working with third party DLLs from within .Net.
But I have documentation summarising the behaviour of the DLL so
fingers crossed it won't be too difficult.

I know that no-one here can advise me in detail on using this
particular DLL, but is it possible to offer any generic guidance on
how to get this going or maybe suggest any web links that might deal
with this topic in outline?

Many thanks if anyone can help.
John Dann

Nov 20 '05 #2
John,
In addition to Philip's links.

If you don't have it you may want to consider purchasing ".NET and COM - The
Complete Interoperability Guide" by Adam Nathan from MS Press. He has a
couple of sections on getting unmanaged Win32 APIs and C DLL calls to work
with .NET.

Hope this helps
Jay

"John Dann" <ne**@prodata.co.uk> wrote in message
news:i3********************************@4ax.com...
I'd like to talk to a (serial port linked) external instrument from
within a .Net project. The makers supply a Win32 compatible DLL
(written in C and not an ActiveX DLL I think) that handles the low
level communication to and from the instrument. So by using the
available DLL, hopefully I can achieve what I need to. Trouble is that
I'm not familiar with working with third party DLLs from within .Net.
But I have documentation summarising the behaviour of the DLL so
fingers crossed it won't be too difficult.

I know that no-one here can advise me in detail on using this
particular DLL, but is it possible to offer any generic guidance on
how to get this going or maybe suggest any web links that might deal
with this topic in outline?

Many thanks if anyone can help.
John Dann

Nov 20 '05 #3
DLL is just a file extention, what is inside the file really matters.Can u
tell me if the DLL u mentioned is a COM Component ?

If that is a COM component, u can transform it into a .NET compatible class
using a command line tool.

VB.NET is good in all aspect, except on using old Com components, since on
..NET, COM is obsolete.

Barry

"John Dann" <ne**@prodata.co.uk> дÈëÓʼþ
news:i3********************************@4ax.com...
I'd like to talk to a (serial port linked) external instrument from
within a .Net project. The makers supply a Win32 compatible DLL
(written in C and not an ActiveX DLL I think) that handles the low
level communication to and from the instrument. So by using the
available DLL, hopefully I can achieve what I need to. Trouble is that
I'm not familiar with working with third party DLLs from within .Net.
But I have documentation summarising the behaviour of the DLL so
fingers crossed it won't be too difficult.

I know that no-one here can advise me in detail on using this
particular DLL, but is it possible to offer any generic guidance on
how to get this going or maybe suggest any web links that might deal
with this topic in outline?

Many thanks if anyone can help.
John Dann

Nov 20 '05 #4

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

Similar topics

8
by: wenmang | last post by:
Hi, We have the 3rd party libraries written in C. And, in every header file from 3rd party, it has the include guarde: #ifdef __cplusplus #define extern "C" { : APIs... : } #endif
0
by: David | last post by:
First, a question. Is there a way to keep VS.NET from red lining elements from third party controls with an error message that says 'the active schema does not support the element ****'? ...
8
by: John Brock | last post by:
I am currently using a VB.NET program to send out e-mails with plain text bodies (plus one attachment). The emails are being received as Rich Text messages (probably just my personal Outlook...
1
by: Lee Greco | last post by:
I'm looking for some advice on how to proceed. Here's the scenario: I've got to develop a high availability VB.Net web service that basically acts as a middle man between the web service...
0
by: tsmith | last post by:
Hi Can somebody help me, please! I'm trying to use a third-party .NET forms control in an unmanaged COM-aware application (MFC). I have no problem doing this with normal .net controls, as...
5
by: Eric Layman | last post by:
Hi, I noticed that PHP have the ability to create PDF files without using any third partty componentys. Most notably is via FPDF. It generates PDF by using "pdf markups" / or ghostscripts I...
3
by: erajaysharma | last post by:
This issue is in Vista. I used XML files(one for DLLs, other for EXEs) ane embeded them in my EXEs and all DLLs ....actually i want to spawn a third party setup from found new hardware...but an...
5
by: rohitchawla | last post by:
How is it possible to read the third party cookies if u have a valid p3p policy set in place I have a server side application that sets the third party cookie and whenever the client visit any...
2
by: newtodotnet | last post by:
Hi, How to Export Gridview to pdf in asp.net I searched in many forums. but many of them said to use third party tools. I don't want any third party tools. Suggest me any sample for without...
3
by: =?Utf-8?B?VG9tIFc=?= | last post by:
When I mouse over a Menu Control based navigation area the drop-down selection list appears instantaneously. Is there a way to make it less sensitive, so that it delays (even a fraction of a second...
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: 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
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
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
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...

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.