Hi
i have a dll that is present in the folder where my VB form is present
i want to load that dll
i know i have to use App.Path but not clear on that
Private Declare Function Output Lib App.path & "\dllname.dll" (ByVal i As
Long) As Long
Will above thing, serve the purpose there is some syntax error can anyone
help me on this
Ralph - 04 Sep 2007 10:39 GMT
> Hi
> i have a dll that is present in the folder where my VB form is present
[quoted text clipped - 6 lines]
> Will above thing, serve the purpose there is some syntax error can anyone
> help me on this
The path can be either a fully qualified path, a relative path to the
current directory, or any folder in the Environment %Path% statement.
The most likely problem is because the search path is different for your
Compiled App and the App when run in the IDE.
Just for grins write a quick app with one form and one textbox that outputs
the App.Path. Then run it in the IDE, then compile (make) the app and run
the exe. Note the difference.
-ralph
Thorsten Albers - 04 Sep 2007 12:12 GMT
CuriousP <CuriousP@discussions.microsoft.com> schrieb im Beitrag
<B8BF0824-DA61-423D-A917-B8E7D31CA371@microsoft.com>...
> i have a dll that is present in the folder where my VB form is present
> i want to load that dll
> i know i have to use App.Path but not clear on that
The search path for a DLL given in a declare statement without any file
path is:
- The directory from which the app has been loaded
- The current directory of the app
- The Windows system directory (e.g. Win 9x: C:\WINDOWS\SYSTEM; Win NT:
C:\WINDOWS\SYSTEM32)
- Win NT only: the 16 bit Windows system directory, e.g. C:\WINDOWS\SYSTEM
- The Windows directory, e.g. C:\WINDOWS
- The directories listed in the PATH environmental variable
So, just put the DLL's filename without any file path components between
the quotation marks behind 'Lib'.
> Private Declare Function Output Lib App.path & "\dllname.dll" (ByVal i As
> Long) As Long
>
> Will above thing, serve the purpose there is some syntax error can anyone
> help me on this
The path can't be specified at run time but only at design time, because
the declare statement isn't a real code statement which is executed at
design time; instead it is a compiler directive resolved only once when the
code gets compiled.

Signature
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------
Howard Kaikow - 30 Sep 2007 18:17 GMT
> Hi
> i have a dll that is present in the folder where my VB form is present
[quoted text clipped - 6 lines]
> Will above thing, serve the purpose there is some syntax error can anyone
> help me on this
I believe that the string has to be specified at compile time.
App.path cannot be resolved until run time;