Click here to Skip to main content
15,891,529 members
Articles / Programming Languages / C#

Lingering COM Objects Caused by ActiveX Control Event Handlers

Rate me:
Please Sign up or sign in to vote.
4.67/5 (6 votes)
14 Mar 20068 min read 45.9K   501   22  
This article describes how, under some circumstances, an ActiveX control event handler can cause COM objects to linger.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="8.00"
	Name="InfoSourcePS"
	ProjectGUID="{6370658D-7BA9-417B-868A-F1D58C5C8D27}"
	Keyword="AtlPSProj"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="$(ConfigurationName)PS"
			IntermediateDirectory="$(ConfigurationName)PS"
			ConfigurationType="2"
			CharacterSet="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
				Description="Checking for required files"
				CommandLine="if exist dlldata.c goto :END&#x0D;&#x0A;echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.&#x0D;&#x0A;Exit 1&#x0D;&#x0A;:END&#x0D;&#x0A;"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0500;REGISTER_PROXY_DLL;_DEBUG"
				RuntimeLibrary="3"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				RegisterOutput="true"
				AdditionalDependencies="kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib"
				ModuleDefinitionFile="InfoSourcePS.def"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCWebDeploymentTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="$(ConfigurationName)PS"
			IntermediateDirectory="$(ConfigurationName)PS"
			ConfigurationType="2"
			CharacterSet="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
				Description="Checking for required files"
				CommandLine="if exist dlldata.c goto :END&#x0D;&#x0A;echo Error: MIDL will not generate DLLDATA.C unless you have at least 1 interface in the main project.&#x0D;&#x0A;Exit 1&#x0D;&#x0A;:END&#x0D;&#x0A;"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="2"
				PreprocessorDefinitions="WIN32;_WIN32_WINNT=0x0500;REGISTER_PROXY_DLL;NDEBUG"
				RuntimeLibrary="2"
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				RegisterOutput="true"
				AdditionalDependencies="kernel32.lib rpcndr.lib rpcns4.lib rpcrt4.lib oleaut32.lib uuid.lib"
				ModuleDefinitionFile="InfoSourcePS.def"
				OptimizeReferences="2"
				EnableCOMDATFolding="2"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCWebDeploymentTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			>
		</Filter>
		<Filter
			Name="Generated Files"
			SourceControlFiles="false"
			>
			<File
				RelativePath=".\_InfoSource_i.c"
				>
			</File>
			<File
				RelativePath=".\_InfoSource_p.c"
				>
			</File>
			<File
				RelativePath=".\dlldata.c"
				>
			</File>
		</Filter>
		<File
			RelativePath=".\InfoSourceps.def"
			>
		</File>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions