"Paul Kirby" <ad***@initcorp.co.uk> wrote in message
news:cb*******************@news.demon.co.uk...
Hello All
I am writing an application and a dll file and I was wondering how I would
access functions within the exe file from the dll?
The need to do this indicates poor program design.
Example:
/* EXE File */
long GetUserCount(void)
{
long count;
...
...
return count;
}
And I want to access the GetUserCount() function from in the dll.
Will I have to copy the exeapp.h to the folder with the dll project in and
link to it that way?
That does not work (as you'd find out if you tried it).
Or is their an easier way to do it?
An easier way, was the last way difficult?
First you have to clarify exactly what you want. Do you want to access the
self same code that is in the exe file, or would you be happy with an
identical copy of that code in you dll?
If its the later then it simply a matter of finding the code that contains
GetUserCount and adding that file and all its dependent files (this may not
be trivial) to your dll 'project'.
If it is the former (i.e. you want the dll to call the code that physically
exists in the exe file) then that is a difficult thing to do and you should
ask on a Windows programming groups where they will be able to tell you how
to do it on the Windows operating system, try
news:comp.os.ms-windows.programmer.win32 for instance. It may not be
possible at all (I'm not a Windows expert).
john