Re: COM objects from SF DLLs

From: Robert Dickow <dickow_at_uidaho.edu>
Date: Fri, 31 Jul 2009 10:44:53 -0700

I'm not informed about how to make a CLR compliant library. However, any DLL
can be accessed from .NET by using the .NET interopservices. In C# for
example, let's say I want to incorporate the 3rd party FTP library called
'ftp4all':

// declare the reference to .NET interop
using System.Runtime.InteropServices;

// ...
// add an attribute before the library's subroutine in the dll:
//
        [DllImport("ftp4w32.dll")]
        static extern int FtpInit(System.IntPtr hWwn);

// then, just call the subroutine with exactly the same function name,
calling as static extern and send it the appropriate
// parameters based on the external libraries param signature.

Works like a charm.

Bob Dickow

-----Original Message-----
From: sftalk-bounce_at_forth.com [mailto:sftalk-bounce_at_forth.com] On Behalf Of
Roger Dube
Sent: Friday, July 31, 2009 6:38 AM
To: sftalk_at_forth.com
Subject: [sftalk] COM objects from SF DLLs

We would like to expose certain Forth functions that we have written to
a .Net application. We're thinking that the easiest way to do so would
be to export our Forth functions as COM objects which can be wrapped by
.Net code and run within a managed CLR environment. Does this
capability exist and does anyone have any simple examples to demonstrate
how it would be accomplished?
Apologies if this has been posted - Having trouble seeing if this posts, and
I am not seeing any copies of it.

- Roger

-- 
Dr. Roger Dube
President/Chief Scientist
Digital Authentication Technologies, Inc.
RogerDube_at_datHQ.com
2101 NW Corporate Blvd # 317
Boca Raton, FL 33431
----------------------------------------------------------------------
sftalk_at_forth.com      The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users.  For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
----------------------------------------------------------------------
sftalk_at_forth.com      The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users.  For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Jul 31 2009 - 10:45:07 PDT

Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 08-Feb-2012. Archive updated nightly.