Hallo,
I understand this code, but I am wandering how to load and use a DLL file, that we have created.
For Example:
Code:
//makedll.cpp
#define EXPORT extern "C" __declspec(dllexport)

EXPORT double sqr(double x)
{
  return x*x;
}
after i compile this code i recieve a makedll.dll file.
Now how can I use the function in this DLL file?
Something like this....?
Code:
//testdll.cpp
#include <cstdlib>
#include <iostream>

#library makedll.dll
extern "C" double sqr(double);

int main(void)
{
    double num;
    printf("STARTing the program");
    printf("\n Enter a number:");
    scanf("%f",&num);
    printf("\n The square of the number is:%f",sqr(num));
    
    system("PAUSE");
    return EXIT_SUCCESS;
}

Last edited by shabbir; 16Oct2006 at 10:20.. Reason: Code formating.