C++: dynamical DLL
Lazy loading in your app
---------------------------DLL extern "C" __declspec(dllexport) int *PushBack(int *x, int &N, int pb) { N++; pb=1; int *tmp=new int[N]; for(int i=0; i#include #include using namespace std; typedef int*(*functionDll)( int *, int&, int ); int main() { HMODULE hLib = LoadLibrary("DLL_Test.dll"); if(hLib) { functionDll fpFunction = (functionDll)GetProcAddress(hLib,"PushBack"); if(fpFunction) { cout << "Function load." << endl; srand ( time(NULL) ); int N =rand() % 10 + 1; //радномим длинны массивов int *y; int *x=new int [N]; //выделяем память для матрицы х for(int i=0; i
0 Comments