I'm rewriting an old VBSCript WSC component into a nicer C# COM Component.
For a horrid reason the old component in one place is passed the Server Context, IServer by using
Set objCurr = CreateObject("MTxAS.AppServer.1")
Set objCurrObjCont = objCurr.GetObjectContext()
Set component.servercontext = objCurrObjCont("Server")
this is then used to do a standard Server.MapPath("/somelocation")
However I'm stumped upon what to do in the .Net COM Component, System.Web.HttpContext.Current.MapPath()
doesn't work as expected as there is no Web Context.
I tried passing the context from Classic ASP into the COM Component but I'm not sure which reference to include so I can invoke the correct member, Microsoft.Active X Data Objects 2.7 seems a common one, but this only includes Recordsets etc, nothing for the C++ IServer interface so it comes our just as a COM OBJECT
.
Does anyone know of a way to do this / a work around? At this rate I'm thinking I may have to change the behaviour of the component