Ticket #116 (new Enhancement)

Opened 5 years ago

Last modified 4 months ago

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

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

Change History

Changed 5 years ago by AlbertStrasheim

Changed 5 years ago by AlbertStrasheim

comment:1 Changed 5 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 5 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 5 years ago by AlbertStrasheim

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

comment:4 Changed 5 years ago by KSMarksPsych

  • Priority changed from Undetermined to Minor

comment:5 Changed 4 years ago by Nicolas

  • Keywords patch added

comment:6 Changed 4 years ago by davea

  • Owner changed from ballen to romw
Note: See TracTickets for help on using tickets.