RE: [DUG]: Translating Virtual paths to physical paths

1999-03-28 Thread Grant Black

I notice this Chris is going through the same learning curve that I did
when writing ASP components in Delphi for the first time. 
 
It was quite stunning for me to find that IIs locks DLL's and won't
release them until shutdown - I thought it was just me not releasing
stuff correctly.  
The answer if you ask MS is to use MTS but that brings its own set of
problems.  

The thing that gets me is what happens when you release your ASP app
onto a commerical web server? - you may find it more difficult just to
shutdown IIs when you have a few hundred people connected. If I was a
commerical web provider I would be worried about hosting an app that
used unknown COM objects + ASP.  



Grant Black
Software Developer
SmartMove (NZ) Ltd
Phone: +64 9 361-0219 extn 719
Fax  : +64 9 361-0211
Email: [EMAIL PROTECTED]


> -Original Message-
> From: Chris Crowe [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 28, 1999 5:43 PM
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Translating Virtual paths to physical paths
> 
> 
> Execelent, exactly what I wanted.
> 
> sServerMapPath := IaspScript.Server.MapPath('.');
> 
> I will try that now..
> 
> How do you test your ASP components?, I find that 
> INETINFO.EXE keeps my DLL in memory, and basically I found 
> that shutting down the IIS Admin Service and then restarting 
> it and the World Wide Web Publishing Service I can then 
> compile my control again. It takes a good 30 seconds to 
> shutdown, recompile, and restart IIS.
> 
> Do you use a similar method or a better way?
> 
> Chris
> 
> Christopher Crowe (Software Developer)
> Microsoft MVP, MCP
> 
> Byte Computer & Software LTD
> P.O Box 13-155 
> Christchurch
> New Zealand
> Phone/Fax (NZ) 03-3651-112
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Neil Anderson
> > Sent: Sunday, 28 March 1999 11:52
> > To: Multiple recipients of list delphi
> > Subject: RE: [DUG]: Translating Virtual paths to physical paths
> > 
> > 
> > You can get ASP stuf from within your app
> > 
> > 
> > eg, incomplete source(hacked out of my file) Hope this helps
> > 
> > Neil
> > 
> > function TTASPBase.OnStartPage(const pScriptContext: 
> IUnknown): Integer;
> > var
> > IaspScript  : IScriptingContext;
> >   sSessionId: widestring;
> >   sApplication  : widestring;
> >   sDataBaseDSN  : widestring;
> >   sServerMapPath  : string;
> > begin
> > if pScriptContext <> nil then begin
> > IaspScript := pScriptContext as IScriptingContext;
> > sSessionId := IaspScript.Session.SessionId;
> > sApplication := IaspScript.Session.get_Value('SOGApplication');
> > sDataBaseDSN := IaspScript.Application.get_Value('DataBaseDSN');
> > if sSessionId = '' then
> >   sSessionId := 'NoSessionId';
> > sServerMapPath := IaspScript.Server.MapPath('.');
> >   end
> >   else begin
> > // Used from test exe so no script context
> > sSessionId   := DEBUGSESSIONID;
> > sServerMapPath := CSERVERMAPPATH;
> >   end;
> > 
> >   if sApplication = '' then
> > sApplication := CDEFAULTAPPLICATION;
> >   if sDataBaseDSN = '' then
> > sDataBaseDSN := CDATABASEDSN;
> > 
> >   FStatusMessage := '(Dsn : '         +  sDataBaseDSN + ') '+
> > '(Map Path : '+ sServerMapPath + ') '+
> > '(Application : ' + sApplication + ') '+
> > '(Session Id : '  + sSessionId +') ';
> > 
> > end;
> > 
> > > -Original Message-
> > > From: Chris Crowe [SMTP:[EMAIL PROTECTED]]
> > > Sent: Sunday, March 28, 1999 10:07 AM
> > > To:   Multiple recipients of list delphi
> > > Subject:  RE: [DUG]:  Translating Virtual paths to physical paths
> > > 
> > > I found that I can use the Server.MapPath command, but I 
> thought my
> > > control could do the translating, It does not matter that 
> much, good
> > > to find a method that works.
> > > 
> > > <%
> > >   FileName = "PageLinks.Txt"
> > >   FileName = Server.MapPath (FileName) 
> > >   Set ObjDelphi = 
> Server.CreateObject("AdrockPageLinks.PageLinks")  
> > >   ObjDelphi.FileName = Fi

RE: [DUG]: Translating Virtual paths to physical paths

1999-03-28 Thread Neil Anderson

Tried once :(,  was under pressure, quite keen to try again sometime.

> -Original Message-
> From: Chris Crowe [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, March 29, 1999 7:28 AM
> To:   Multiple recipients of list delphi
> Subject:      RE: [DUG]:  Translating Virtual paths to physical paths
> 
> Sounds like the best option Neil. I will start to do that as well. Do
> you then put your objects into MTS?, if so any tips there?
> 
> Chris
> 
> Christopher Crowe (Software Developer)
> Microsoft MVP, MCP
> 
> Byte Computer & Software LTD
> P.O Box 13-155 
> Christchurch
> New Zealand
> Phone/Fax (NZ) 03-3651-112
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Neil Anderson
> > Sent: Monday, 29 March 1999 06:56
> > To: Multiple recipients of list delphi
> > Subject: RE: [DUG]: Translating Virtual paths to physical paths
> > 
> > 
> > I write simple Delphi test apps to test the COM objects, I call
> > onStartpage with pScriptContext = nil, see sample code.
> > 
> > Once I have moved to ASP I use the start and stop bat files I posted
> to
> > "Unable to create file" thread
> > 
> > Neil
> > 
> > > -Original Message-
> > > From: Chris Crowe [SMTP:[EMAIL PROTECTED]]
> > > Sent: Sunday, March 28, 1999 5:43 PM
> 
> --
> -
> New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
>   Website: http://www.delphi.org.nz
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



RE: [DUG]: Translating Virtual paths to physical paths

1999-03-28 Thread Chris Crowe

Sounds like the best option Neil. I will start to do that as well. Do you then put 
your objects into MTS?, if so any tips there?

Chris

Christopher Crowe (Software Developer)
Microsoft MVP, MCP

Byte Computer & Software LTD
P.O Box 13-155 
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Neil Anderson
> Sent: Monday, 29 March 1999 06:56
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Translating Virtual paths to physical paths
> 
> 
> I write simple Delphi test apps to test the COM objects, I call
> onStartpage with pScriptContext = nil, see sample code.
> 
> Once I have moved to ASP I use the start and stop bat files I posted to
> "Unable to create file" thread
> 
> Neil
> 
> > -Original Message-
> > From:   Chris Crowe [SMTP:[EMAIL PROTECTED]]
> > Sent:   Sunday, March 28, 1999 5:43 PM

---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



RE: [DUG]: Translating Virtual paths to physical paths

1999-03-28 Thread Neil Anderson

I write simple Delphi test apps to test the COM objects, I call
onStartpage with pScriptContext = nil, see sample code.

Once I have moved to ASP I use the start and stop bat files I posted to
"Unable to create file" thread

Neil

> -Original Message-
> From: Chris Crowe [SMTP:[EMAIL PROTECTED]]
> Sent: Sunday, March 28, 1999 5:43 PM
> To:   Multiple recipients of list delphi
> Subject:  RE: [DUG]:  Translating Virtual paths to physical paths
> 
> Execelent, exactly what I wanted.
> 
> sServerMapPath := IaspScript.Server.MapPath('.');
> 
> I will try that now..
> 
> How do you test your ASP components?, I find that INETINFO.EXE keeps
> my DLL in memory, and basically I found that shutting down the IIS
> Admin Service and then restarting it and the World Wide Web Publishing
> Service I can then compile my control again. It takes a good 30
> seconds to shutdown, recompile, and restart IIS.
> 
> Do you use a similar method or a better way?
> 
> Chris
> 
> Christopher Crowe (Software Developer)
> Microsoft MVP, MCP
> 
> Byte Computer & Software LTD
> P.O Box 13-155 
> Christchurch
> New Zealand
> Phone/Fax (NZ) 03-3651-112
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Neil Anderson
> > Sent: Sunday, 28 March 1999 11:52
> > To: Multiple recipients of list delphi
> > Subject: RE: [DUG]: Translating Virtual paths to physical paths
> > 
> > 
> > You can get ASP stuf from within your app
> > 
> > 
> > eg, incomplete source(hacked out of my file) Hope this helps
> > 
> > Neil
> > 
> > function TTASPBase.OnStartPage(const pScriptContext: IUnknown):
> Integer;
> > var
> > IaspScript  : IScriptingContext;
> >   sSessionId: widestring;
> >   sApplication  : widestring;
> >   sDataBaseDSN  : widestring;
> >   sServerMapPath  : string;
> > begin
> > if pScriptContext <> nil then begin
> > IaspScript := pScriptContext as IScriptingContext;
> > sSessionId := IaspScript.Session.SessionId;
> > sApplication := IaspScript.Session.get_Value('SOGApplication');
> > sDataBaseDSN := IaspScript.Application.get_Value('DataBaseDSN');
> > if sSessionId = '' then
> >   sSessionId := 'NoSessionId';
> > sServerMapPath := IaspScript.Server.MapPath('.');
> >   end
> >   else begin
> > // Used from test exe so no script context
> > sSessionId   := DEBUGSESSIONID;
> > sServerMapPath := CSERVERMAPPATH;
> >   end;
> > 
> >   if sApplication = '' then
> > sApplication := CDEFAULTAPPLICATION;
> >   if sDataBaseDSN = '' then
> > sDataBaseDSN := CDATABASEDSN;
> > 
> >   FStatusMessage := '(Dsn : '     +  sDataBaseDSN + ') '+
> > '(Map Path : '+ sServerMapPath + ') '+
> > '(Application : ' + sApplication + ') '+
> > '(Session Id : '  + sSessionId +') ';
> > 
> > end;
> > 
> > > -Original Message-
> > > From: Chris Crowe [SMTP:[EMAIL PROTECTED]]
> > > Sent: Sunday, March 28, 1999 10:07 AM
> > > To:   Multiple recipients of list delphi
> > > Subject:  RE: [DUG]:  Translating Virtual paths to physical paths
> > > 
> > > I found that I can use the Server.MapPath command, but I thought
> my
> > > control could do the translating, It does not matter that much,
> good
> > > to find a method that works.
> > > 
> > > <%
> > >   FileName = "PageLinks.Txt"
> > >   FileName = Server.MapPath (FileName) 
> > >   Set ObjDelphi = Server.CreateObject("AdrockPageLinks.PageLinks")
> 
> > >   ObjDelphi.FileName = FileName
> > >   ObjDelphi.Name= "Chris Crowe"
> > >   ObjDelphi.WriteInfo
> > > 
> > >   Set ObjDelphi = Nothing
> > > 
> > > %>
> > > 
> > > Thanks..
> > > 
> > > Christopher Crowe (Software Developer)
> > > Microsoft MVP, MCP
> > > 
> > > Byte Computer & Software LTD
> > > P.O Box 13-155 
> > > Christchurch
> > > New Zealand
> > > Phone/Fax (NZ) 03-3651-112
> > > 
> > > 
> > > > -Original Message-
> &

RE: [DUG]: Translating Virtual paths to physical paths

1999-03-28 Thread Chris Crowe

Execelent, exactly what I wanted.

sServerMapPath := IaspScript.Server.MapPath('.');

I will try that now..

How do you test your ASP components?, I find that INETINFO.EXE keeps my DLL in memory, 
and basically I found that shutting down the IIS Admin Service and then restarting it 
and the World Wide Web Publishing Service I can then compile my control again. It 
takes a good 30 seconds to shutdown, recompile, and restart IIS.

Do you use a similar method or a better way?

Chris

Christopher Crowe (Software Developer)
Microsoft MVP, MCP

Byte Computer & Software LTD
P.O Box 13-155 
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Neil Anderson
> Sent: Sunday, 28 March 1999 11:52
> To: Multiple recipients of list delphi
> Subject: RE: [DUG]: Translating Virtual paths to physical paths
> 
> 
> You can get ASP stuf from within your app
> 
> 
> eg, incomplete source(hacked out of my file) Hope this helps
> 
> Neil
> 
> function TTASPBase.OnStartPage(const pScriptContext: IUnknown): Integer;
> var
>   IaspScript  : IScriptingContext;
>   sSessionId  : widestring;
>   sApplication: widestring;
>   sDataBaseDSN: widestring;
>   sServerMapPath  : string;
> begin
>   if pScriptContext <> nil then begin
>   IaspScript := pScriptContext as IScriptingContext;
>   sSessionId := IaspScript.Session.SessionId;
> sApplication := IaspScript.Session.get_Value('SOGApplication');
> sDataBaseDSN := IaspScript.Application.get_Value('DataBaseDSN');
> if sSessionId = '' then
>   sSessionId := 'NoSessionId';
> sServerMapPath := IaspScript.Server.MapPath('.');
>   end
>   else begin
>   // Used from test exe so no script context
>   sSessionId   := DEBUGSESSIONID;
> sServerMapPath := CSERVERMAPPATH;
>   end;
> 
>   if sApplication = '' then
> sApplication := CDEFAULTAPPLICATION;
>   if sDataBaseDSN = '' then
> sDataBaseDSN := CDATABASEDSN;
> 
>   FStatusMessage := '(Dsn : ' +  sDataBaseDSN + ') '+
> '(Map Path : '+ sServerMapPath + ') '+
> '(Application : ' + sApplication + ') '+
>             '(Session Id : '  + sSessionId +') ';
> 
> end;
> 
> > -Original Message-
> > From:   Chris Crowe [SMTP:[EMAIL PROTECTED]]
> > Sent:   Sunday, March 28, 1999 10:07 AM
> > To: Multiple recipients of list delphi
> > Subject:RE: [DUG]:  Translating Virtual paths to physical paths
> > 
> > I found that I can use the Server.MapPath command, but I thought my
> > control could do the translating, It does not matter that much, good
> > to find a method that works.
> > 
> > <%
> >   FileName = "PageLinks.Txt"
> >   FileName = Server.MapPath (FileName) 
> >   Set ObjDelphi = Server.CreateObject("AdrockPageLinks.PageLinks")  
> >   ObjDelphi.FileName = FileName
> >   ObjDelphi.Name= "Chris Crowe"
> >   ObjDelphi.WriteInfo
> > 
> >   Set ObjDelphi = Nothing
> > 
> > %>
> > 
> > Thanks..
> > 
> > Christopher Crowe (Software Developer)
> > Microsoft MVP, MCP
> > 
> > Byte Computer & Software LTD
> > P.O Box 13-155 
> > Christchurch
> > New Zealand
> > Phone/Fax (NZ) 03-3651-112
> > 
> > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On
> > > Behalf Of Laurence Bevan
> > > Sent: Saturday, 27 March 1999 23:03
> > > To: Multiple recipients of list delphi
> > > Subject: Re: [DUG]: Translating Virtual paths to physical paths
> > > 
> > > 
> > > Why not use FileSystemObject directly from ASP? What type of file is
> > it?
> > > 
> > > Laurence Bevan
> > > 
> > > 
> > > --
> > > -
> > > New Zealand Delphi Users group - Delphi List -
> > [EMAIL PROTECTED]
> > >   Website: http://www.delphi.org.nz
> > > 5ìy©ZÐÞ-~bRÇ«²
> > 躐Þ-~b.+-uéi?'^-~b¢¸'Íg>²+^?Ûiÿü0Á×¥¦¨®   ó
> --
> -
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>   Website: http://www.delphi.org.nz
> 
{^jV§t7¥¦”±ê삺.¤7¥¦‹ŠË]zZa‰×¥¦¨®óYæìŠ×¡¶Úÿ0uéi†*+‚|


RE: [DUG]: Translating Virtual paths to physical paths

1999-03-27 Thread Neil Anderson

You can get ASP stuf from within your app


eg, incomplete source(hacked out of my file) Hope this helps

Neil

function TTASPBase.OnStartPage(const pScriptContext: IUnknown): Integer;
var
IaspScript  : IScriptingContext;
  sSessionId: widestring;
  sApplication  : widestring;
  sDataBaseDSN  : widestring;
  sServerMapPath  : string;
begin
if pScriptContext <> nil then begin
IaspScript := pScriptContext as IScriptingContext;
sSessionId := IaspScript.Session.SessionId;
sApplication := IaspScript.Session.get_Value('SOGApplication');
sDataBaseDSN := IaspScript.Application.get_Value('DataBaseDSN');
if sSessionId = '' then
  sSessionId := 'NoSessionId';
sServerMapPath := IaspScript.Server.MapPath('.');
  end
  else begin
// Used from test exe so no script context
sSessionId   := DEBUGSESSIONID;
sServerMapPath := CSERVERMAPPATH;
  end;

  if sApplication = '' then
sApplication := CDEFAULTAPPLICATION;
  if sDataBaseDSN = '' then
sDataBaseDSN := CDATABASEDSN;

  FStatusMessage := '(Dsn : ' +  sDataBaseDSN + ') '+
'(Map Path : '+ sServerMapPath + ') '+
'(Application : ' + sApplication + ') '+
'(Session Id : '  + sSessionId +') ';

end;

> -Original Message-----
> From: Chris Crowe [SMTP:[EMAIL PROTECTED]]
> Sent: Sunday, March 28, 1999 10:07 AM
> To:   Multiple recipients of list delphi
> Subject:  RE: [DUG]:  Translating Virtual paths to physical paths
> 
> I found that I can use the Server.MapPath command, but I thought my
> control could do the translating, It does not matter that much, good
> to find a method that works.
> 
> <%
>   FileName = "PageLinks.Txt"
>   FileName = Server.MapPath (FileName) 
>   Set ObjDelphi = Server.CreateObject("AdrockPageLinks.PageLinks")  
>   ObjDelphi.FileName = FileName
>   ObjDelphi.Name= "Chris Crowe"
>   ObjDelphi.WriteInfo
> 
>   Set ObjDelphi = Nothing
> 
> %>
> 
> Thanks..
> 
> Christopher Crowe (Software Developer)
> Microsoft MVP, MCP
> 
> Byte Computer & Software LTD
> P.O Box 13-155 
> Christchurch
> New Zealand
> Phone/Fax (NZ) 03-3651-112
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> > Behalf Of Laurence Bevan
> > Sent: Saturday, 27 March 1999 23:03
> > To: Multiple recipients of list delphi
> > Subject: Re: [DUG]: Translating Virtual paths to physical paths
> > 
> > 
> > Why not use FileSystemObject directly from ASP? What type of file is
> it?
> > 
> > Laurence Bevan
> > 
> > 
> > --
> > -
> > New Zealand Delphi Users group - Delphi List -
> [EMAIL PROTECTED]
> >   Website: http://www.delphi.org.nz
> > 5ìy©ZÐÞ-~bRÇ«²
> 躐Þ-~b.+-uéi?'^-~b¢¸'Íg>²+^?Ûiÿü0Á×¥¦¨® ó
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz



RE: [DUG]: Translating Virtual paths to physical paths

1999-03-27 Thread Chris Crowe

I found that I can use the Server.MapPath command, but I thought my control could do 
the translating, It does not matter that much, good to find a method that works.

<%
  FileName = "PageLinks.Txt"
  FileName = Server.MapPath (FileName) 
  Set ObjDelphi = Server.CreateObject("AdrockPageLinks.PageLinks")  
  ObjDelphi.FileName = FileName
  ObjDelphi.Name= "Chris Crowe"
  ObjDelphi.WriteInfo

  Set ObjDelphi = Nothing

%>

Thanks..

Christopher Crowe (Software Developer)
Microsoft MVP, MCP

Byte Computer & Software LTD
P.O Box 13-155 
Christchurch
New Zealand
Phone/Fax (NZ) 03-3651-112


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Laurence Bevan
> Sent: Saturday, 27 March 1999 23:03
> To: Multiple recipients of list delphi
> Subject: Re: [DUG]: Translating Virtual paths to physical paths
> 
> 
> Why not use FileSystemObject directly from ASP? What type of file is it?
> 
> Laurence Bevan
> 
> 
> --
> -
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>   Website: http://www.delphi.org.nz
> 5ìy©ZÐޖ˜bRÇ«²
躐ޖ˜b.+-uéi†'^–˜b¢¸'Íg›²+^†Ûiÿü0Á×¥¦¨®   ó


Re: [DUG]: Translating Virtual paths to physical paths

1999-03-27 Thread Laurence Bevan

Why not use FileSystemObject directly from ASP? What type of file is it?

Laurence Bevan


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz