|
From: Jasbir C. <cha...@ya...> - 2001-05-06 21:17:10
|
I am trying to learn how to make dll in Dev-C++. My Program is as follows:
#include <windows.h>
#include <stdio.h>
#include <string.h>
#define DllExport extern "C" __declspec (dllexport)
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason,
LPVOID reserved /* Not used. */ );
/* DllMain Results:
TRUE on success, FALSE on failure. */
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;
}
return TRUE;
}
DllExport void ShowMouseLoc(HDC hdc, LPARAM lParam)
{
char str[80];
wsprintf(str, "Button is down at %d, %d",
LOWORD(lParam), HIWORD(lParam));
TextOut(hdc, LOWORD(lParam), HIWORD(lParam),
str, strlen(str));
}
When I compile it gives me following linker errors:
f:codelocalschildtswin98chap21 ewmydll.o(.text+0x93):mydll.cpp: undefined reference to `TextOutA@20'
Warning: no export definition file provided
dllwrap will create one, but may not be what you want
F:DEV-C_~1BINdllwrap: gcc exited with status 1
If I take out TextOut line it makes dll and lib file without any error? I don't know what I am doing wrong. I would like to know what more I have to insert in the program so that linker see the TextOut statement.
Jasbir Chauhan
---------------------------------
Do You Yahoo!?
Yahoo! Auctions - Click and bid on cool stuff like Dave Matthews Band Tickets & more! |