Link to home
Start Free TrialLog in
Avatar of TungVan
TungVan

asked on

Function declaration


Hello,

First, I will describe the problem:

1) I have 2 DLLs in 2 folders (file, and npdir)

2) file folder generate file.dll and npdir generate npdir.dll

3) in file folder: filesave.c have the following function

BOOL            DelFilesNDir(HWND hwnd, char * szPath, BOOL bMoveFlag);

4) in npdir folder: npdir.c have the same function

BOOL      DelFilesNDir(HWND hwnd, char * szPath, BOOL bMoveFlag)



They are the same function but placed in 2 different folder. I find it a bit redundant

Can I declare this function in file only? and then use some sort of mechanism in npdir folder to access this function in file?


Thanks



Avatar of Infinity08
Infinity08
Flag of Belgium image

You still want to have that function in both DLL's, but you want only one source file for the function ?

That's easy, just add the .c file in both projects.

An even better way is to make a (static) library for that function (and any other similar shared functions), and include the library in both projects.
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TungVan
TungVan

ASKER


Thanks, i guess this is the best solution, right?
Maybe someone else has a brighter idea ... just keep this thread open for a while :)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial