Вверх ↑
Ответов: 1841
Рейтинг: 369
#1: 2014-11-09 01:16:57 ЛС | профиль | цитата
Ну и C++ до кучи
#include <iostream>
#include <windows.h>

using namespace std;

int main()
{
//load library
HINSTANCE hinstLib = LoadLibrary(L"swedll32.dll");
if (hinstLib == NULL) {
cout << "ERROR: unable to load DLL
";
return 1;
}

//get point func - swe_julday
typedef int (*import_swe_julday)(int year, int mon, int mday, double hour, int gregflag);
import_swe_julday swe_julday = (import_swe_julday)GetProcAddress(hinstLib, "_swe_julday@24");
if (swe_julday == NULL) {
cout << "ERROR: unable to find DLL function
";
return 1;
}

//get point func - swe_calc
typedef int (*import_swe_calc)(double tjd, int ipl, int iflag, double *xx, char *serr);
import_swe_calc swe_calc = (import_swe_calc)GetProcAddress(hinstLib, "_swe_calc@24");
if (swe_calc == NULL) {
cout << "ERROR: unable to find DLL function
";
return 1;
}


//use func
cout << swe_julday(1990,11,11,11,1) << endl;
double xx[6];
cout << swe_calc(1990,11,0,xx,NULL) << endl;

return 0;
}
карма: 1
0