Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having problems with my Stream Reader

Status
Not open for further replies.

YvonneTsang

Programmer
Sep 28, 2001
37
CA
I have a .NET dll that is registered for COM use(Regasm/gacutil). Inside here I need to read from a text file to get some settings for the application. The location of the text file can change(depending on where the application is installed). I am trying to determine how to get to my file location. I tried to just keep the file in the same location as the DLL but when the COM object is used it references c:\winnt\system32 not the real location of the DLL. I tried to use an environment variable and it gave me c:\%MyVar%\settings.text. I am soooooo stuck. Someone please help me.
 
Can you have the calling application pass you it's path?

Otherwise, you'll probably need to do some registry look-ups to find out where your COM-registered assembly is installed. (Use the ProgID to find the ClsID, then use the ClsID to find the InProcServer32 registry key)

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top