I just wrote my first small DLL, and it works, so far.
But I have a question: Will Windows always find my .DLL file
when a .DLL function is called, if it is in same directory as
the .EXE that calls it? (Or what if it were in a different
directory? Does that matter?)
When I SHELL to another .EXE, I can use the PathSpec$ of the
main .EXE, once it has been determined, in the SHELL
command. (I'm using some code, thanx to Fred Oxenby, that he
posted, slightly modified for getting PathSpec$) Yet I see no
way to make sure Windows will "see" my .DLL. Is that a problem?
I thought perhaps the precaution to take was to include a
PathSpec$ (or $PathSpec constant) in the DECLARE for the .DLL
function that is in the .EXE, such as:
$PathSpec = "C:\PBDLL60\MYFILES\"
DECLARE FUNCTION GetMyData LIB $PathSpec & "MYDLL.DLL" _
ALIAS "GetMyData" (BYVAL x AS LONG) AS LONG
However, I see that isn't allowed. (Compile error 429, "String
constant expected"). Same problem, even if I use:
$PathSpec = "C:\PBDLL60\MYFILES\MYDLL.DLL"
So, does Windows simply look in the same directory as the .EXE
for the .DLL file, at the time the .EXE is loaded? And if so,
how does one call a .DLL that's NOT in the same directory?
Dumb questions, from a raw rookie.
------------------
[This message has been edited by Mike Jenkins (edited July 21, 2001).]
But I have a question: Will Windows always find my .DLL file
when a .DLL function is called, if it is in same directory as
the .EXE that calls it? (Or what if it were in a different
directory? Does that matter?)
When I SHELL to another .EXE, I can use the PathSpec$ of the
main .EXE, once it has been determined, in the SHELL
command. (I'm using some code, thanx to Fred Oxenby, that he
posted, slightly modified for getting PathSpec$) Yet I see no
way to make sure Windows will "see" my .DLL. Is that a problem?
I thought perhaps the precaution to take was to include a
PathSpec$ (or $PathSpec constant) in the DECLARE for the .DLL
function that is in the .EXE, such as:
$PathSpec = "C:\PBDLL60\MYFILES\"
DECLARE FUNCTION GetMyData LIB $PathSpec & "MYDLL.DLL" _
ALIAS "GetMyData" (BYVAL x AS LONG) AS LONG
However, I see that isn't allowed. (Compile error 429, "String
constant expected"). Same problem, even if I use:
$PathSpec = "C:\PBDLL60\MYFILES\MYDLL.DLL"
So, does Windows simply look in the same directory as the .EXE
for the .DLL file, at the time the .EXE is loaded? And if so,
how does one call a .DLL that's NOT in the same directory?
Dumb questions, from a raw rookie.

------------------
[This message has been edited by Mike Jenkins (edited July 21, 2001).]
Comment