User:Strayway

on the internet, I find that almost website introduce the programming how to call dll file,but most programming like c#,c++,vb and so on ,but there is no document to introduce ho to create dll in c and using dll in c, so i try to do it ,then it was lucky ,i was ok,so do follow with me:

1. you should create a new project using visual studio 2003, and using the

console project, and select the dll at the second step.

2. and you add the dlls.h files ,and write this sentence:

int add(int numa, int numb);

3. and you also add the dlls.c file,and write this sentence:

int add(int numa, int numb) {     return numa + numb; }

4.and last create another new project named test.and add the test.c file:

#include     #include      #include 

HINSTANCE hinstance; typedef int (*Add)(int a, int b); Add add;

int main {       //load the dll file hinstance = LoadLibrary("dll.dll"); //get the funtion address add = (Add)GetProcAddress(hinstance, "add"); printf("2 + 3 = %d",add(2, 3)); FreeLibrary(hinstance); getchar; return 0; }