Ticket #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
Change History
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);
}
}
}

