how to know the active directory for the COM Addin

G

Guest

Hi,

In my COM Add-in Project, I need to creat a temp directory under the
Installation directory of the COM Addin, once the COM is loaded.

Is there a way to know the actual directory that the setup program is gonna
install the COM at the developing time. Thanks
 
M

Michael Bauer

Am Wed, 14 Dec 2005 14:40:27 -0800 schrieb lostwings:

It´s the App.Path property.
 
D

Dmitry Streblechenko

Why do you need to create a subfolder where your dll is installed?
Unless you are an admin or a power user, you cannot create subfolders in
C:\Program Files. Why not use app data folders either for the current user
or for all users?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
G

Guest

The reason I want to create a sub directory under th COM AddIn install
directory is because I want to store some pic files downloaded from a certain
web site physically on user's hard drive, and then let user's contact items
for the outlook refer to these pics locally.

I was using the FileStream .Net class library, and I didn't find any
trouble creating sub directory under C:\program files even if the user is not
the admin or power user. I am confused at the "why not use app data folders"
you mentioned, would you explain a little bit more on that, thanks.
 
D

Dmitry Streblechenko

I mean the following folder (do not hardcode its name):
C:\Documents and Settings\All Users\Application Data

Again, creating a subfolder in C:\Program Files during install is fine
(since your app folder needs to be created anyway), but do not modiy
anything there during the normal execution, when a user might not have
rights to that folder. Just try to log in using a guest account...

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
G

Guest

There is a way to know the physical directory of the COM Addin at run time by
writing

Dim path As String
path =
System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)

However, I still don't know what the App.path property mean under the COM
Add in context, please give me some advice on that, I am really a rookie in
microsoft programming world. Thanks in advance.
 
M

Michael Bauer

Am Thu, 15 Dec 2005 21:40:02 -0800 schrieb lostwings:

App.Path is available in VB, not in VB.NET.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top