Opened 19 years ago
Last modified 14 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)
Change History (8)
Changed 19 years ago by
| Attachment: | boinc_api.patch added |
|---|
Changed 19 years ago by
| Attachment: | libboincapidll.vcproj added |
|---|
comment:1 Changed 19 years ago by
comment:2 Changed 19 years ago by
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 19 years ago by
It looks like boinc_init_diagnostics should also be part of the API.
comment:4 Changed 18 years ago by
| Priority: | Undetermined → Minor |
|---|
comment:5 Changed 18 years ago by
| Keywords: | patch added |
|---|
comment:6 Changed 18 years ago by
| Owner: | changed from Bruce Allen to romw |
|---|

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.