Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a dll

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Dear all,

I coded some c a decade ago... sigh yeah i know i should refresh it more often.

Here's my problem.

In our Powerbuilder program we make use of an external software package. To modify the procedure they use, they provided us some info and told us to change the dll file. I need to know all the different steps to create a dll. I don't need the info an creatin the exe cause this is done by the external software supplier.

Here's what i have till now

3 files being bridge.c, bridge.h, bridge.def

Contents of bridge.h

#ifndef __DBTBRIDGE__H
#define __DBTBRIDGE__H
#include <windows.h>

BOOL WINAPI DllEntryPoint( HINSTANCE hDll,
DWORD fdwReason,
LPVOID lpvReserved );

typedef int (WINAPI *LPFNEXPORTED)(void);
BOOL WINAPI SetValues( HINSTANCE EXEh, HWND hwnd, char *code, char *values );

#endif

Contents of bridge.def

EXPORTS
DllEntryPoint
SetValues

Contents of bridge.c

#include &quot;windows.h&quot;
#define MAXLEN (20000)
#include &quot;dbtbridge.h&quot;

int main()
{}

BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
return(1);
}

BOOL WINAPI SetValues( HINSTANCE EXEh, HWND hwnd, char *code, char *values )
{
char textout[MAXLEN];

sprintf( textout, &quot;The code is [%s]&quot;, code );
MessageBox( hwnd, &quot;Code Test&quot;, textout, MB_OK );
sprintf( textout, &quot;The value is [%s]&quot;, values );
MessageBox( hwnd, &quot;Value Test&quot;, textout, MB_OK );
}

You might want to take a look at my code also, it compiles without warnings/errors but i might have coded something wrong. I can compile my bridge.c , but i don't know how to create my dll. This dll adapted and created by us, will be copied over the existing dll, so the dll is triggered from within the external software.

I hope i make sense...

Any help is highly appreciated

PS I use Dev-C++ as editor/compiler.

Vanleeuwe John
john@sofdes.com
 
I'm afraid I'm not familiar with your software package, and I'm even less familiar with using a DEF file for a DLL. But if your software package is anything like VC++, at some point you need to declare a function as dllexport. Here's a prototype from a DLL I wrote last week:

unsigned char __declspec(dllexport) CheckRAM(void);

Beyond that, I'm afraid I will not be able to help you.

---Evil Peer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top