Opened 18 years ago

Last modified 13 years ago

#116 new Enhancement

Provide libboincapi as a DLL

Reported by: AlbertStrasheim Owned by: romw
Priority: Minor Milestone: Undetermined
Component: BOINC - API Version:
Keywords: patch Cc:

Description

It would be very useful if libboincapi were available as a DLL. It seems that this should make it very easy to write BOINC client applications in C# or other .NET languages using .NET's DllImport? feature.

Preliminary patch and VS project file is attached. There are still a few issues that someone more knowledgeable might tackle:

  • boinc_resolve_filename is defined in multiple headers, causing DLL linkage issues
  • I don't quite know how to support the graphics functions that are supposed to be provided by the application yet
  • don't know if delayimp.lib should be included when linking

Attachments (2)

boinc_api.patch (3.1 KB) - added by AlbertStrasheim 18 years ago.
libboincapidll.vcproj (4.6 KB) - added by AlbertStrasheim 18 years ago.

Download all attachments as: .zip

Change History (8)

Changed 18 years ago by AlbertStrasheim

Attachment: boinc_api.patch added

Changed 18 years ago by AlbertStrasheim

Attachment: libboincapidll.vcproj added

comment:1 Changed 18 years ago by AlbertStrasheim

One more minor issue: the filename of the .lib that is generated should be changed, since it currently overwrites the .lib made by the libboincapi static library project.

comment:2 Changed 18 years ago by AlbertStrasheim

The following C# application appears to work as expected:

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace ConsoleApplication1
{
    class Program
    {
        [DllImport("libboincapi.dll")]
        static extern int boinc_init();

        [DllImport("libboincapi.dll")]
        static extern int boinc_finish(int status);

        [DllImport("libboincapi.dll")]
        static extern int boinc_is_standalone();

        static void Main(string[] args)
        {
            int retval = boinc_init();
            retval = boinc_is_standalone();
            boinc_finish(0);
        }
    }
}

comment:3 Changed 18 years ago by AlbertStrasheim

It looks like boinc_init_diagnostics should also be part of the API.

comment:4 Changed 17 years ago by KSMarksPsych

Priority: UndeterminedMinor

comment:5 Changed 17 years ago by Nicolas

Keywords: patch added

comment:6 Changed 17 years ago by davea

Owner: changed from Bruce Allen to romw
Note: See TracTickets for help on using tickets.