|
-
Aug 28th, 2005, 08:37 PM
#1
Thread Starter
Hyperactive Member
Retrieving Drive Letter
Is it possible to retrieve the Drive letter you're program is on?
Like for example: C:\
Not the current folder but just the Drive letter.
Possible?
-
Aug 28th, 2005, 08:39 PM
#2
Re: Retrieving Drive Letter
 Originally Posted by Tantrum3k
Is it possible to retrieve the Drive letter you're program is on?
Like for example: C:\
Not the current folder but just the Drive letter.
Possible?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 28th, 2005, 08:42 PM
#3
Thread Starter
Hyperactive Member
Re: Retrieving Drive Letter
It possible without using App.Path?
Or does App.Path work also in a DLL? No EXE...
-
Aug 28th, 2005, 08:44 PM
#4
Re: Retrieving Drive Letter
 Originally Posted by Tantrum3k
It possible without using App.Path?
Or does App.Path work also in a DLL? No EXE...
I am not exactly sure if it will work in a dll or not?
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."
-
Aug 28th, 2005, 08:46 PM
#5
Thread Starter
Hyperactive Member
Re: Retrieving Drive Letter
I've tried using App.Path and GetCurrentDirectory in my DLL project and when I used them it just exited. Could have been a coincidence, though.
Any other theories on this?
-
Aug 28th, 2005, 08:51 PM
#6
Re: Retrieving Drive Letter
App.Path should work in any type of executable: DLL or EXE.
-
Aug 28th, 2005, 08:53 PM
#7
Thread Starter
Hyperactive Member
Re: Retrieving Drive Letter
Isn't .DLL a library and not an executable?
-
Aug 28th, 2005, 09:17 PM
#8
Re: Retrieving Drive Letter
 Originally Posted by Tantrum3k
Isn't .DLL a library and not an executable?
Yes. However the point Rhino is making is valid; App.Path should work for you in a ActiveX.DLL created in VB.
-
Aug 28th, 2005, 09:17 PM
#9
Re: Retrieving Drive Letter
You are confused - DLL stands for "dynamic link library" but it is also an executable file. Difference between dll and standard exe is that dll cannot run on its own so it has to be interfaced (or linked if you will). And I am referring to ActiveX.dll of course created in VB.
-
Aug 28th, 2005, 09:26 PM
#10
Thread Starter
Hyperactive Member
Re: Retrieving Drive Letter
You think App.Path would still work with a standard DLL that exports functions in vb6? I'm talking about using an Add-In that makes it possible like vbadvanced for example(which does work because I've used it for months).
-
Aug 29th, 2005, 05:47 AM
#11
Re: Retrieving Drive Letter
 Originally Posted by Tantrum3k
You think App.Path would still work with a standard DLL that exports functions in vb6? I'm talking about using an Add-In that makes it possible like vbadvanced for example(which does work because I've used it for months).
It should, but the only way to find out is do it and see what happens.
-
Aug 30th, 2005, 01:30 AM
#12
Re: Retrieving Drive Letter
It depends who calls it. If it is a non-VB program then the global objects (App etc.) won't exist, and COM interfaces most probably won't be referenced (unless it is a C++ COM app or something). That makes it a bit hard.
If it is a VB program then the global objects will be loaded and so it should work.
I can't remember the API to find the process path but there is one somewhere so if you find that then use it because it will work much better.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|