1

14 years ago when I was a green horn, setting up the components for classic ASP was not in my pay grade... Now however, I have gone back to the future and I find myself having to maintain and code against a classic ASP project using a COM object.

Now I'm finding myself looking at ancient articles dated from 1999 to 2001 and I'm wondering if anyone has a good answer as to why the COM (ActiveX .dll) should have Unattended Execution and Retained in Memory set?

I should also note, that the current architecture of the site are these .dlls just dropped on the server (registered of course). I'm wondering about COM+ and MTS. We are sticking with classic ASP for now (long story). However, I'm hoping to move to .NET with the quickness. So if I can minimize the maintenance time of this current architecture that would be helpful. Can you please also give me a reason why we should use COM+ and MTS? As well as what would be involved with adding those features.

webdad3
  • 8,893
  • 30
  • 121
  • 223

1 Answers1

5

Unattended Execution prevents your VB6 binary from showing an interactive Dialog, i.e. a window on the server that your webclient would be unable to see or interact with.

This could be a Msgbox() or a runtime error popup. When Unattended Execution is flagged, runtime errors are logged to the Windows Event Log.

Retained in memory prevents IIS (or your host) from immediately releasing your DLL. Depending on your host setup, the DLL will be retained in memory and reused. Some hosts (such as IIS) will release the DLL after some time.

See also: You can configure the Unattended Execution option and the Retained In Memory option in the latest version of Msvbvm60.dll

You must turn on the Unattended Execution option and the Retained In Memory option before compilation to host a Microsoft Visual Basic Enterprise Edition for Windows 6.0 component (Microsoft ActiveX DLL) in a multi-threaded environment, such as Microsoft Transaction Server (Mtx.exe), Internet Information Services (Inetinfo.exe), COM+ (Dllhost.exe), and Microsoft SQL Server 7.0 or SQL Server 2000 (Sqlservr.exe). However, you may not know whether a component is going to be used in such an environment or you may forget to turn on the Unattended Execution option and the Retained In Memory option. To address this problem, the latest version of the Visual Basic runtime (Msvbvm60.dll) introduces a new feature that permits you to turn on the Unattended Execution option and the Retained In Memory option at run time.

And: Threading issues with Visual Basic 6.0 ActiveX components

  • Access Violation inside MSVBVM60.DLL.
  • Client enters a deadlock state. You may see these two symptoms if a Visual Basic ActiveX DLL is hosted in a multi-threaded environment, for example, IIS, MTS, or a multi-threaded client, and the Retain In Memory option is not enabled.

And, of course: Visual Basic Reference General Tab (Project Properties Dialog Box)

Unattended Execution Indicates that the project is intended to run without user interaction. Unattended projects have no interface elements. Any run-time functions such as messages that normally result in user interaction are written to an event log.

Retained in Memory Retains a project in memory. However, there is a performance cost: A project retained in memory is not unloaded until the process terminates.

magma
  • 8,432
  • 1
  • 35
  • 33
  • +1 Thats a good answer for Unattended Execution... What about Retained in Memory? – webdad3 Apr 18 '11 at 22:34
  • Do you have any info on why I should recommend COM+ and MTS? – webdad3 Apr 18 '11 at 22:45
  • 2
    I can't find any good reason to recommend a set of technologies introduced when the leading Windows OS was NT4. You need to get rid of your VB6 dependence right now, and switch to .NET. Several services that were provided by MTS/COM+ have been replaced by .NET counterparts. Since you're already planning to move to .NET anyway, why would you want to bring your VB6 components to COM+, where VB6 binaries are 2nd-class citizens anyway? – magma Apr 18 '11 at 22:55
  • excellent information about Retained in Memory and Unattended Execution – webdad3 Apr 18 '11 at 22:56
  • @magma - I agree. This version of the software has been developed for many years... They want this version out and then go to .NET. I'm really trying to see if I need to recommend it if it will help me in the long run to get it to .NET... – webdad3 Apr 18 '11 at 22:58
  • @magma - by not recommending are you then recommending that we stay with the current architecture (of .dlls on the server)? The problem is, I'm not familiar with COM+ or MTS... I'm not even sure it would help... – webdad3 Apr 18 '11 at 22:59
  • @Jeff, I'll let someone more knowledgeable about COM+ add their opinion; I was involved in two COM+ projects a few years ago and I remember devastating headaches :) So I'm certainly biased. Not that you're not going to have issues with .NET, but at least, you'll be relying on a vibrant community instead of having to dig old, unsupported and hard-to-find information on the internet. Make your client (or boss) understand that in the long run, it's just cheaper to convert to a newer platform. – magma Apr 18 '11 at 23:02
  • @Jeff of course it's your call, because I don't know the background, but I'd suggest that you freeze the system as is - and start converting to .NET (or your modern platform of choice) as soon as possible. I understand that the code is not yours; converting VB6 components so that they can benefit from the COM+ architecture is not trivial, and it's time best spent writing new code. – magma Apr 18 '11 at 23:04
  • 2
    MTS is part of COM+, it was combined with DTC to form COM+ when Win2K came out. You can find more about the topic at http://msdn.microsoft.com/en-us/library/ms685978(VS.85).aspx .Net uses COM+, within a thick wrapper called Enterprise Services. – Bob77 Apr 19 '11 at 00:35