Thanks for the answers, friends …
I bought Eugene’s books and they’re fine. In fact, I think the best thing is that before constructing the plugin, I will make a DLL and use “declares” to access their functions.
My first attempts were successful (I was able to create the DLL and I could access a couple of simple functions)…
However, when trying to access more complex elements (for example, pointers to structures, or FILE *), I got lost and not in a correct way, for example…
My sampleheader.h
[code]typedef double (*genann_actfun) (double a);
typedef struct genann {
int inputs, hidden_layers, hidden, outputs;
genann_actfun activation_hidden;
genann_actfun activation_output;
int total_weights;
int total_neurons;
double *weight;
double *output;
double *delta;
} genann;
extern __declspec(dllexport) int32_t DoubleValue(int32_t x); //dummy test…
extern __declspec(dllexport) const char *genann_version(void);
extern __declspec(dllexport) genann *genann_init(int inputs, int hidden_layers, int hidden, int outputs);
extern __declspec(dllexport) genann *genann_read(FILE *in);
extern __declspec(dllexport) void genann_randomize(genann *ann);[/code]
My sample.c
#include “dllmain.h”
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <stdio.h>
[code]int32_t DoubleValue(int32_t x)
{
return 2 * x;
}
const char *genann_version(void)
{
return “0.0.1 20170207”;
}
genann *genann_init(int inputs, int hidden_layers, int hidden, int outputs)
{
return NULL; //pseudo-mock
}
genann *genann_read(FILE *in)
{
return NULL; //pseudo-mock
}
void genann_randomize(genann *ann)
{
//manage *ann…
}
[/code]
My problems appear with the management of pointers to the structure, and FILE* …
how do I call them from Xojo?