Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Launching a COM object
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01400670
Message ID:
01400820
Views:
39
>>>>I have created a COM server in an EXE file to server as a report server. The COM object is registered and is physically located in a folder adjacent to my website. It loads and works perfectly using the command oServer = createobject("myserver.mytools") when run within the mini server that comes with VWD. However when run through IIs it will not load and produces an error that says "Cannot create ActiveX object". I have set the folder permissions for IUSER and DCOMCNFG but still get this error. Is there something else I need to do to allow the NET page access to a folder outside its own root folder?
>>>
>>>Cassini (the "built-in" web server) runs under the context of the currently logged in user. Your production code (under IIS) runs under a different account. It's actually different under different versions of IIS. IIS 6 under Windows Server 2003 runs under the NETWORK SERVICE account. IIS 5 ran under the ASPNET account.
>>
>>Yes, we've noticed that there is a connection to NETWORK SERVICE but so far that hasn't given us the clue we need. Here is a little more info based on experimentation. Assuming the problem has to do with permissions or access or something like that, I decided to test with another COM server already up and running in another website. So here is the scenario. Website1 uses a VFP.EXE as a COM server for pdf generation. It has been up and running without a problem for over a year. The COM server is physically located in the same folder as website1. Website2 is now in development and wants to use the same VFP.EXE to service its printing needs. When website1 issues oServer = createobject("myserver.myserver") everything works fine. When website2 issues the same command, it fails with an error that says "Cannot create ActiveX object". It would appear that although the internet user has full access to the website1 folder, website2 does not. That's only a guess but the best I can do at the moment. Perhaps what I'm trying to do (write a generic COM server that will function with multiple sites) is not possible. Both websites are written in VB.NET.
>
>Is this "other folder" on the same machine or is it a network share? COM components can't use mapped drive letters, you have to use the UNC path (that is, instead of something like: G:\SomeFolder it would be \\MyServer\MyShare\SomeFolder). Also, have you given NETWORK SERVICE the ability to launch this COM component via DCOMCNFG?

Yes we used DCOMCNFG to provide NETWORK SERVICE with access to the COM file. This produced a slightly different result. Whereas before the failure and error message was immediate, now the website/browser seems to hang for a minute or so before it reports the same error. IE Cannot create ActiveX object. Further digging shows that the reason is a timeout waiting for the COM to report back that it had started. Here is the frontend of the code. Do you see anything that might be producing the problem? Remember it works fine in the Cassini environment.
*************************************************************
define class FoxReportServer as session olepublic
*************************************************************
	cAppStartPath = ""
	cBasePath = ""
	lError = .f.
	cErrorMessage = ""
	cOutputFile = ""
	cSQL = ""
	cReportName = ""
	cLogFile = ""
	cDataFolder = ""
	cReportFolder = ""

************************************************************************
* FoxReportServer :: Init
************************************************************************
	function init
		set resource off
		set exclusive off
		set cpdialog off
		set deleted on
		set exact off
		set safety off
		set reprocess to 2 seconds
		if inlist(_vfp.startmode,2,3,5)
			set default to (justpath(_vfp.servername))
		endif
		public crlf
		crlf = chr(13)+chr(10)
		this.cLogFile = "foxReportServer.log"
		erase (this.cLogFile)
		dodefault()

*** Utility routines
		strtofile("Start at: " + ttoc(datetime()) + crlf,this.cLogFile,1)

		this.cAppStartPath = addbs(justpath(application.servername))	&& c:\inetpub\wwwroot\foxreportserver\
		this.cBasePath = addbs(justpath(justpath(this.cAppStartPath)))	&& c:\inetpub\wwwroot\
		set path to (this.cAppStartPath)

		strtofile("INIT complete at: " + ttoc(datetime()) + crlf,this.cLogFile,1)
	endfunc
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform