Ticket #116 (new Enhancement)

Opened 1 year ago

Last modified 6 months ago

Provide libboincapi as a DLL

Reported by: AlbertStrasheim Assigned to: 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 (3.1 kB) - added by AlbertStrasheim on 04/21/07 16:11:13.
libboincapidll.vcproj (4.6 kB) - added by AlbertStrasheim on 04/21/07 16:11:57.

Change History

04/21/07 16:11:13 changed by AlbertStrasheim

  • attachment boinc_api.patch added.

04/21/07 16:11:57 changed by AlbertStrasheim

  • attachment libboincapidll.vcproj added.

04/21/07 16:12:58 changed 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.

04/21/07 16:14:00 changed 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);
        }
    }
}

04/22/07 02:09:59 changed by AlbertStrasheim

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

06/08/07 07:53:57 changed by KSMarksPsych

  • priority changed from Undetermined to Minor.

02/05/08 15:43:24 changed by Nicolas

  • keywords set to patch.

02/05/08 16:13:07 changed by davea

  • owner changed from ballen to romw.

If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.