Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data paths in COM
Message
From
07/04/2000 07:35:25
Scott Knight
Human Resources Development Canada
St. John's, Newfoundland, Canada
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00355583
Message ID:
00356730
Views:
27
>I have your ASPObjects white paper and your book which generated the challenge. Erik Moore had the answer which you can read in the message it basically used the following :

MTXAs.AppServer.1 in conjunction with GetContextObject() and Request.ServerVariables("APPL_PHYSICAL_PATH").
(Path to the Application not the DLL)

I may have been a little unclear in my message but I wasn't sure what I was looking for. I had tried the approach you describe below and found like you say the path to the DLL was returned. However, while I have you on the wire why does the Application.ServerName work and what is it. I have search MS for it and it seems to be non existent. I also searched your site and found .ServerName and .Fullname. What other properties are available or where can I find fererence to them.

Thanks



Scott

I wouldn't recommend putting the data in the registry or anywhere else for that maatter because your app in a COM object may not have access to that.
>
>The best way IMHO is to figure out a base path (like the location of the DLL) and based on that establish the startup environment. I use the DLL path for this which goes into an app directory which has related files there along with it incuding local data if used.
>
>You can use:
>
>
>*** Data must sit in the DLL's startup path
>*** Servername returns this value
>THIS.cDataPath = ADDBS( JustPath(Application.Servername) )
>
>DO PATH WITH THIS.cDataPath
>DO PATH WITH\ THIS.cDataPath + "data"
>
>etc.
>
>
>+++ rick ---
>
>
>>I am trying to avoid hard coding paths in several components I have built. Ideally, I would like to set a property (MyObject.CappStartpath) in the MyObject.init that would reflect the the path of the IIS application that has instantiated it. Something like "d:\Inetpub\wwwroot\webfax\", webfax being the application. The data is in a "data" subdirectory from webfax.
>>
>>I have figured out a two step work around when it is called from ASP but when instantiating from inside another component I'm stuck. The two step would look something like this:
>>
>>Set oTools = Server.CreateObject("WebClasses.HTMLTools")
>>oTools.cAppStartpath = Request.ServerVariables("APPL_PHYSICAL_PATH")
>>
>>
>>If I could pass Request.Server... Value to the INIT of the Object as it is Instantiated I could live with it. I would like for the MyOject.init to set it itself some how if possible. Any thoughts would be much appreciated.
>>
>>Thanks
>>
>>
>>Scott
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform