Article ID: 264957 - View products that this article applies to.
This article was previously published under Q264957
The Visual Basic 6.0 ActiveX DLL may cause COM+ applications and Active Server Pages (ASP) to stop responding (crash or hang) if you do not select the Unattended Execution and Retain in Memory options.
Visual Basic runtime behaves differently based on whether you select the Unattended Execution and the Retain in Memory options are selected. When you do not select these options, the Visual Basic runtime unloads custom and runtime DLLs unexpectedly, which causes the computer to stop responding (crash or hang) under some multithreaded scenarios. Typical scenarios include when you place the ActiveX DLL in COM+ or Microsoft Transaction Server (MTS), or when you call the ActiveX DLL from ASP pages.
Note As in many multithreading issues, the symptoms may only manifest themselves under very specific and transient conditions.
To resolve this problem, set the Retain In Memory option as follows:
Note Before Service Pack 3 for Visual Studio 6.0, it was possible to get an access violation during process shutdown with Retain in Memory enabled. This has been fixed in Visual Studio 6.0, Service Pack 3 or later
This behavior is by design.
Note In Visual Studio 6, Service Pack 5, when a project contains any public class that has MTSTransactionMode set to anything other than 0, the Unattended Execution and Retain In Memory options are automatically selected.
For a comprehensive list of guidelines and tips about how to develop COM+ applications with Visual Basic, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/en-us/library/ms809241.aspxFor additional information on threading issues with Visual Basic 6.0 ActiveX components, click the article number below to view the article in the Microsoft Knowledge Base:
241896For additional information on threading issues with Visual Basic 5.0 ActiveX components, see the following article:
(http://support.microsoft.com/kb/241896/EN-US/ )PRB: Threading Issues with Visual Basic 6.0 ActiveX Components
(http://support.microsoft.com/kb/186273/EN-US/ )BUG: AV Running VB-Built Component in Multi-Threaded Environment