#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;
}
Ответов: 1841
Рейтинг: 369
|
|||
Ну и C++ до кучи
|
|||
карма: 1 |
|