Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / September 2007



Tip: Looking for answers? Try searching our database.

App.Path

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CuriousP - 04 Sep 2007 06:12 GMT
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;
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.