If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Referencing dll from another program

Hello,

I'm trying to reference a dll created by another program. I don't think I can distribute the dll(s) with my program, so I need to be able to find them in their native directories. I have the following function right now:

Re: Referencing dll from another program

I believe they are native dlls. I'm completely new to using dlls in C#; I was successfully able to integrate a .NET assembly and call its function just by adding a reference to the dll in solution explorer, but in that case I was licensed to redistribute the dll which is not the case here.

The following are excerpts from the API's documentation. Do I need to somehow define the data types from the API in my own program? All I need is to call the functions below.

The API uses character strings and integers for information input/output.

All strings are unsigned 8-bit character strings (uint8_t*) encoded in UTF-8 and are null-terminated.
All codes are unsigned 32-bit integers (uint32_t).
All array sizes and positions use the unsigned data type size_t.
File paths are case-sensitive if the underlying file system is case-sensitive.
The API also introduces three new structures:
typedef struct _boss_db_int * boss_db;
The boss_db structure abstracts the definition of BOSS's internal state while still providing type safety across the API.
typedef struct {
uint32_t id;
const uint8_t * name;
} BashTag;
The BashTag structure gives the Unique Identifier (UID) for each Bash Tag and the corresponding Bash Tag name.
typedef struct {
uint32_t type;
const uint8_t * message;
} BossMessage;
The BossMessage structure gives the type of a message and the message string itself.

...

BOSS API provides the functions listed below to clients. Where a function returns a uint32_t value, this is the function's return code.
...
Load - Loads the masterlist and userlist from the paths specified, for the game specified when the given database was created. Can be called multiple times. If an error is encountered, the database remains unchanged. Calling this function for a database that has already been loaded will reload it, freeing any memory allocated by functions that take a boss_db argument, and scanning the data directory specified when the database was created for newly added plugins.
uint32_t Load (boss_db db, const uint8_t * masterlistPath, const uint8_t * userlistPath);
db - The database the function acts on.
masterlistPath - A string containing the relative or absolute path to the masterlist file that should be loaded.
userlistPath - A string containing the relative or absolute path to the userlist file that should be loaded. If NULL, no userlist will be loaded.
...
These functions require a database to be created, but do not require Load to have been called. Plugins should be passed with their unghosted filenames, whether or not they are currently ghosted.

GetActivePlugins - Returns the contents of plugins.txt.
uint32_t GetActivePlugins (boss_db db, uint8_t *** plugins, size_t * numPlugins);
db - The database the function acts on.
plugins - The outputted array of active plugins. If the textfile-base load order system is being used, these plugins will be in load order, otherwise their order is undefined. If numPlugins is 0, this will be NULL.
numPlugins - The size of the outputted plugins array.
...