Click here to Skip to main content
15,885,366 members
Articles / Desktop Programming / WTL

Add a WTL MDI window into an ATL Control

Rate me:
Please Sign up or sign in to vote.
4.77/5 (12 votes)
11 Sep 20031 min read 68.1K   1.6K   20  
This article will show you how to make MDI window of WTL into ATL control by using a real world example.
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="7.10"
	Name="MdiControl"
	ProjectGUID="{83304ED6-C333-4B0D-8BB8-365702BFC02D}"
	Keyword="AtlProj">
	<Platforms>
		<Platform
			Name="Win32"/>
	</Platforms>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="Debug"
			IntermediateDirectory="Debug"
			ConfigurationType="2"
			UseOfATL="1"
			ATLMinimizesCRunTimeLibraryUsage="FALSE"
			CharacterSet="2">
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL"
				MinimalRebuild="TRUE"
				BasicRuntimeChecks="3"
				RuntimeLibrary="1"
				UsePrecompiledHeader="3"
				WarningLevel="3"
				Detect64BitPortabilityProblems="TRUE"
				DebugInformationFormat="4"/>
			<Tool
				Name="VCCustomBuildTool"/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="TRUE"
				OutputFile="$(OutDir)/MdiControl.dll"
				LinkIncremental="2"
				ModuleDefinitionFile=".\MdiControl.def"
				GenerateDebugInformation="TRUE"
				SubSystem="2"
				ImportLibrary="$(OutDir)/MdiControl.lib"
				TargetMachine="1"/>
			<Tool
				Name="VCMIDLTool"
				PreprocessorDefinitions="_DEBUG"
				MkTypLibCompatible="FALSE"
				TargetEnvironment="1"
				GenerateStublessProxies="TRUE"
				TypeLibraryName="$(IntDir)/MdiControl.tlb"
				HeaderFileName="MdiControl.h"
				DLLDataFileName=""
				InterfaceIdentifierFileName="MdiControl_i.c"
				ProxyFileName="MdiControl_p.c"/>
			<Tool
				Name="VCPostBuildEventTool"
				Description="Performing registration"
				CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"/>
			<Tool
				Name="VCPreBuildEventTool"/>
			<Tool
				Name="VCPreLinkEventTool"/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="_DEBUG"
				Culture="2052"
				AdditionalIncludeDirectories="$(IntDir)"/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"/>
			<Tool
				Name="VCXMLDataGeneratorTool"/>
			<Tool
				Name="VCWebDeploymentTool"/>
			<Tool
				Name="VCManagedWrapperGeneratorTool"/>
			<Tool
				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="Release"
			IntermediateDirectory="Release"
			ConfigurationType="2"
			UseOfATL="1"
			ATLMinimizesCRunTimeLibraryUsage="FALSE"
			CharacterSet="2">
			<Tool
				Name="VCCLCompilerTool"
				PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL"
				RuntimeLibrary="0"
				UsePrecompiledHeader="3"
				WarningLevel="3"
				Detect64BitPortabilityProblems="TRUE"
				DebugInformationFormat="3"/>
			<Tool
				Name="VCCustomBuildTool"/>
			<Tool
				Name="VCLinkerTool"
				IgnoreImportLibrary="TRUE"
				OutputFile="$(OutDir)/MdiControl.dll"
				LinkIncremental="1"
				ModuleDefinitionFile=".\MdiControl.def"
				GenerateDebugInformation="TRUE"
				SubSystem="2"
				OptimizeReferences="2"
				EnableCOMDATFolding="2"
				ImportLibrary="$(OutDir)/MdiControl.lib"
				TargetMachine="1"/>
			<Tool
				Name="VCMIDLTool"
				PreprocessorDefinitions="NDEBUG"
				MkTypLibCompatible="FALSE"
				TargetEnvironment="1"
				GenerateStublessProxies="TRUE"
				TypeLibraryName="$(IntDir)/MdiControl.tlb"
				HeaderFileName="MdiControl.h"
				DLLDataFileName=""
				InterfaceIdentifierFileName="MdiControl_i.c"
				ProxyFileName="MdiControl_p.c"/>
			<Tool
				Name="VCPostBuildEventTool"
				Description="Performing registration"
				CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"/>
			<Tool
				Name="VCPreBuildEventTool"/>
			<Tool
				Name="VCPreLinkEventTool"/>
			<Tool
				Name="VCResourceCompilerTool"
				PreprocessorDefinitions="NDEBUG"
				Culture="2052"
				AdditionalIncludeDirectories="$(IntDir)"/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"/>
			<Tool
				Name="VCXMLDataGeneratorTool"/>
			<Tool
				Name="VCWebDeploymentTool"/>
			<Tool
				Name="VCManagedWrapperGeneratorTool"/>
			<Tool
				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
			<File
				RelativePath=".\MdiControl.cpp">
			</File>
			<File
				RelativePath=".\MdiControl.def">
			</File>
			<File
				RelativePath=".\MdiControl.idl">
			</File>
			<File
				RelativePath=".\MdiEx.cpp">
			</File>
			<File
				RelativePath=".\stdafx.cpp">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="1"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="1"/>
				</FileConfiguration>
			</File>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl;inc;xsd"
			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
			<File
				RelativePath=".\_IMdiExEvents_CP.h">
			</File>
			<File
				RelativePath=".\MdiEx.h">
			</File>
			<File
				RelativePath=".\Resource.h">
			</File>
			<File
				RelativePath=".\stdafx.h">
			</File>
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
			<File
				RelativePath=".\res\MdiControl.ico">
			</File>
			<File
				RelativePath=".\MdiControl.rc">
			</File>
			<File
				RelativePath=".\MdiControl.rgs">
			</File>
			<File
				RelativePath=".\res\MdiControlDoc.ico">
			</File>
			<File
				RelativePath=".\MdiEx.bmp">
			</File>
			<File
				RelativePath=".\MdiEx.rgs">
			</File>
			<File
				RelativePath=".\res\toolbar.bmp">
			</File>
		</Filter>
		<Filter
			Name="Generated Files"
			SourceControlFiles="FALSE">
			<File
				RelativePath=".\MdiControl_i.c">
				<FileConfiguration
					Name="Debug|Win32">
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="0"/>
				</FileConfiguration>
				<FileConfiguration
					Name="Release|Win32">
					<Tool
						Name="VCCLCompilerTool"
						UsePrecompiledHeader="0"/>
				</FileConfiguration>
			</File>
		</Filter>
		<Filter
			Name="MdiWnd"
			Filter="">
			<File
				RelativePath=".\AboutDlg.h">
			</File>
			<File
				RelativePath=".\ChildFrm.h">
			</File>
			<File
				RelativePath=".\MainFrm.h">
			</File>
			<File
				RelativePath=".\MdiControlView.h">
			</File>
		</Filter>
		<Filter
			Name="YF"
			Filter="">
			<File
				RelativePath=".\YF_Control.h">
			</File>
			<File
				RelativePath=".\YF_Module.cpp">
			</File>
			<File
				RelativePath=".\YF_Module.h">
			</File>
		</Filter>
		<File
			RelativePath=".\MdiEx.htm"
			DeploymentContent="TRUE">
		</File>
		<File
			RelativePath=".\ReadMe.txt">
		</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
Web Developer
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