From: rvdt@oce.nl (Rob van den Tillaart)
Date: Mon, 22 Sep 2003 09:01:41 +0200
Subject: [Tiff] (no subject)
References: <MJEBIBGMCDKIGEHPDECCMENJCBAA.pushkar@erc.msstate.edu>
Message-ID: <3F6E9E55.FE8F7962@oce.nl>

Hi Ryan,

Just started with C# myself, so not an expert opinion. 
(except for an exercise at a course no experience with this topic)

It is possible to use libraries written in C/C++ from C#. In dotnet
vocabulary it is called "unmanaged code".
To use unmanaged code you must use a statement like this: 


[DllImport("msvcrt.dll", CharSet=CharSet.Ansi)]
public static extern int puts(String s);

static void Main()
{
    String message = "just some message";
    puts(message);
}

Often you will also need the "MarshallAs" attribute. This attribute can
be used with a field in a class or struct,
or with a parameter of a method or to handle the returnvalue.

>From the win32API:	struct example
	public struct PAINTSTRUCT 
	{
		public HDC hdc;
		public int fErase;
		public RECT rcPaint;
		public int fRestore;
		public int fIncUpdate;
		[MarshalAs(UnmanagedType.ByValArray, SizeConst=32)] public byte
rgbReserved;
	}


With these 2 terms "DllImport" and "MarshallAs" you must be able to find
all relevant 
details in the manual. 

reagrds,
rob tillaart

 


Pushkar Pradhan wrote:
> 
> Ryan,
> Implement as part of your C# project? Do you mean you want to use it in your
> C# code, right?
> It depends if C code is part of C# then you can, like C can be used in C++.
> 
> -----Original Message-----
> From: tiff-admin@remotesensing.org
> [mailto:tiff-admin@remotesensing.org]On Behalf Of Ryan Yeow
> Sent: Saturday, September 20, 2003 11:36 PM
> To: tiff@remotesensing.org
> Subject: [Tiff] (no subject)
> 
> hi, I'm trying to implement this library as part of my
> C# project. Can it be used in such case? I'm a
> beginner in image processing so any help is
> appreciated. Thanks.
> 
> =====
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> _______________________________________________
> Tiff mailing list
> Tiff@remotesensing.org
> http://remotesensing.org/mailman/listinfo/tiff
> 
> _______________________________________________
> Tiff mailing list
> Tiff@remotesensing.org
> http://remotesensing.org/mailman/listinfo/tiff

