Ó
ÓÚÑó
Hi all!
I have a Dll like this:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
__declspec (dllexport) int Add (int n)
{
int x;
x = 100 + n;
return x;
}
And I use this to call the Dll:
#include "windows.h"
#include "stdio.h"
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int iCmdShow)
{
HINSTANCE hAdd;
FARPROC Add;
if(hAdd= LoadLibrary ("Add.dll"))
{
Add = GetProcAddress (hAdd, "Add");
printf ("%i\n", Add(100));
FreeLibrary (hAdd);
}
}
After compiling,there is an error:too many arguments to function.
Please tell me how can i correct my code. Thanks in advance!!
I have a Dll like this:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
__declspec (dllexport) int Add (int n)
{
int x;
x = 100 + n;
return x;
}
And I use this to call the Dll:
#include "windows.h"
#include "stdio.h"
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int iCmdShow)
{
HINSTANCE hAdd;
FARPROC Add;
if(hAdd= LoadLibrary ("Add.dll"))
{
Add = GetProcAddress (hAdd, "Add");
printf ("%i\n", Add(100));
FreeLibrary (hAdd);
}
}
After compiling,there is an error:too many arguments to function.
Please tell me how can i correct my code. Thanks in advance!!