NetTalk Central

Author Topic: Using HOST app - Problem with startup folder  (Read 3698 times)

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Using HOST app - Problem with startup folder
« 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using HOST app - Problem with startup folder
« Reply #1 on: February 28, 2012, 12:54:37 AM »
there is a property.... let me dig it out for you....

Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Using HOST app - Problem with startup folder
« Reply #2 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Using HOST app - Problem with startup folder
« Reply #3 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


Devan

  • Full Member
  • ***
  • Posts: 230
    • View Profile
    • Email
Re: Using HOST app - Problem with startup folder
« Reply #4 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