hi,
thanks for ur reply...but stiil i am not able to access the dll functions.........
This is my dll.h file:
Code:
#ifndef _DLL_H_
#define _DLL_H_
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
DLLIMPORT void HelloWorld (void);
#endif /* _DLL_H_ */
this is my dllmain.c file
Code:
#include "dll.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
DLLIMPORT void HelloWorld ()
{
printf("\n hai");
}
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
I am able to compile my dll without any erros.
This is my .c file in which i invoke the dll:
Code:
#include <stdio.h>
#include <windows.h>
#include <stdlib.h>
#include "dll.h"
int main(int argc, char *argv[])
{
HelloWorld();
system("PAUSE");
return 0;
}
when i compile this .c file i get a compile time error in the makefile.win...this is the exact error:
C:\Dev-Cpp\test4\Makefile.win [Build Error] [test4.exe] Error 1
Please help me out...Should i change any of the project settings while accessing the dll?