NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Devan on February 28, 2012, 12:43:29 AM

Title: Using HOST app - Problem with startup folder
Post by: Devan on February 28, 2012, 12:43:29 AM
Hi all,

We've just started using the HOST.EXE NetTalk demo app to run several WebServer.dll processes on a single server, but we have just come across a big problem that I am unsure how to solve.

When the individual WebServer NT apps were being run standalone, they used to load up some site specific settings in a file called 'websettings.xml' in the EXE folder.

Now that they are DLL's and being run from within HOST.EXE, their effective startup folder is the same folder as HOST.EXE, not the individual site folder.  Thus the DLL's do not find their settings.

How can I get each subsite to load their setting from their local DLL folder, and not the HOST.EXE folder? (Without hard coding the path, which would make it a pain to move files around later)?

Cheers,
Devan
Title: Re: Using HOST app - Problem with startup folder
Post by: Bruce on February 28, 2012, 12:54:37 AM
there is a property.... let me dig it out for you....
Title: Re: Using HOST app - Problem with startup folder
Post by: Devan on February 28, 2012, 06:17:07 PM
Thanks Bruce - sure would appreciate a 'heads up' on this... Client wants this solution deployed this week!  ;D
Title: Re: Using HOST app - Problem with startup folder
Post by: Bruce on February 28, 2012, 09:36:09 PM
clip(p_web.site.appPath)
contains the location of the DLL - I usually use this in the WebHandler procedure, as part of the code to set the file paths.
the property should contain a trailing '\'.

I also notice the shipping examples are missing the site1 and site2 files - I've fixed that for the next build.

Cheers
Bruce

Title: Re: Using HOST app - Problem with startup folder
Post by: Devan on February 28, 2012, 10:05:30 PM
Bruce,

Is this run on the DLL's WebHandler procedure?  What is the best embed point for that? Init()?

The init code I've got is in the WebServer procedure of the DLL.  I've tried:

ThisWebServer.AppPath but that only gives me the path of the calling HOST.EXE program...

Cheers,
Devan