|
From: Rodrigo H. <rod...@ac...> - 2001-09-26 18:08:11
|
Dear Dev-C++ users,
I'm trying to build a DLL to use with other applications made in Delphi =
and VB.
The code below is a very simple DLL I tried to make using Dev-C++.
It compiles perfectly and creates the DLL file.
But appears the warning: "no export definition file provided; dllwrap =
will create one, but may not be what you want".
I noticed that it uses the file "dll.def" and modifies the name of the =
function in the DLL to "TimesTwo__Fi".
I created a .DEF file, which is below, that I wanted the linker to use. =
How could be this possible?
Does anyone have a simple DLL made with Dev-C++, in C language?
Thanks in advance,
Rodrigo Hjort
rod...@ac...
**** C source code *****
#include <windows.h>
int WINAPI _export TimesTwo(int x);
/* int extern TimesTwo(int x); */ /*also tried this*/
BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL,=20
DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH: break;
case DLL_THREAD_ATTACH: break;
case DLL_PROCESS_DETACH: break;
case DLL_THREAD_DETACH: break;
}
return TRUE;
}
int WINAPI _export TimesTwo(int x)
/*int extern TimesTwo(int x)*/
{
return x * 2;
}
*************************
*** DEF file ******
LIBRARY Sample
DESCRIPTION 'SAMPLE DLL'
CODE PRELOAD MOVABLE DISCARDABLE
DATA PRELOAD SINGLE
EXPORTS
TimesTwo
*******************
|