PDA

View Full Version : check dll function during installation



NewsArchive
03-01-2008, 03:52 AM
Hi

during instalaltion i want the call dll to open a dll that is already on the
hard disk, check the contents of a tps file in the same directory as the
dll, and return an answer.

My question is :

If SB does the CALL DLL , is the dll opened in the current 'temp' directory
of the installation, or in the specified directory i put in ? iow.. if my
tps fiel is called 'myfile.tps' and it is in c:\myfolder....will the dll
call read for it in c:\myfolder\myfile.tps or in %tempdir%\myfile.tps ?

If the latter, how do i specify where the dll must be opened so it can read
the correct tps file ....?

Kind @Regards

Ben

NewsArchive
03-01-2008, 03:52 AM
Hi Ben,

If the DLL is already on the system then you have to specify the exact
location of that DLL to call it.

If the installer calls a function from within a DLL then it's always a good
idea to use fully qualified path names in your DLL because you never know
what the default folder is at the time when the function is called.

The above is true for all development environments when calling into DLLs.

Does this help?

Friedrich

NewsArchive
03-01-2008, 03:54 AM
Hi

When my system calls functions in the dll, they KNOW where the files are, so
the ycan use fully qualified path names, but when SB calls the function, all
i know is that SB is in a temp directory.

Can I name my file myfilename = PATH() & '\myfile.tps' ??? will
path() equate to the temp directory the instalaltion is in, or to the
location of where the dll is located... ??

see image .....

ah ... don't worry ..discussing this with you, I just pick up the install
directory, and pass that as a parameter to the function, so it knows where
to go look for the tps file ..


See image


thanks for the discussion

Ben

NewsArchive
03-01-2008, 03:55 AM
Hi Ben,

The Clarion PATH() returns the current directory. And it's possible that
this path is *not* the folder where the application itself is located in ;-)
So never rely on PATH() in this case.

What you are doing now with picking up the installalation directory (e.g.
using "Get System Information" -> "Installer Path Name") is the correct way!

Friedrich