I don't know much about VB but shouldn't you be declaring the vars as ByRef
Declare Function c_add_c Lib ".\simpdll\SimpDLL.DLL" Alias "c_add" (ByRef a As Complex, ByRef c As Complex) As Complex
Declare Function dc_add_c Lib ".\simpdll\SimpDLL.DLL" Alias "dc_add" (ByRef a As Complex_16, ByRef b As Complex_16) As Complex_16
Here is a sample listing that shows your functions work the same as an ordinary complex add, so the problem I think must be in you VB code or VB calls.
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include <complex.h>
float complex WINAPI fc_add(float complex * a1, float complex * a2)
{
float complex fc;
fc = *a1 + *a2;
return fc;
}
double complex WINAPI dc_add(double complex * a1, double complex * a2)
{
double complex dc;
dc = *a1 + *a2;
return dc;
}
int main(void)
{
double complex dc2, dc3, dc4;
float complex fc5, fc6, fc7;
dc4 = 7+I*30;
dc2 = 8+I*31;
dc3 = dc_add(&dc4, &dc2);
// printf the result of dc_add()
printf("dc3 = %f, %f\n", creal(dc3), cimag(dc3));
// check dc_add
dc3 = dc4 + dc2;
printf("dc3 = %f, %f\n", creal(dc3), cimag(dc3));
fc7 = 7+I*30;
fc5 = 8+I*31;
fc6 = fc_add(&fc7, &fc5);
// printf the result of fc_add()
printf("fc6 = %f, %f\n", crealf(fc6), cimagf(fc6));
// check fc_add
fc6 = fc7 + fc5;
printf("fc6 = %f, %f\n", crealf(fc6), cimagf(fc6));
return 0;
}
John