Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / C#

Using the .NET managed TCP/IP classes in a managed C++ appplication

Rate me:
Please Sign up or sign in to vote.
4.67/5 (3 votes)
15 Oct 20012 min read 82.3K   2.3K   21  
This sample demonstrates a basic technique of networking using the TCP/IP protocol in a managed C++ application by implementing a simple POP3 client.
<?xml version="1.0"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="7.00"
	Name="Pop3Client"
	Keyword="managed c">
	<Build>
		<Settings>
			<Platform
				Name="Win32"/>
			<Configuration
				Name="Debug|Win32"
				IntermediateDirectory="Debug"
				OutputDirectory="Debug"
				ConfigurationType="1"
				CharacterSet="2"
				ManagedExtensions="TRUE">
				<Tool
					Name="VCBscMakeTool"/>
				<Tool
					Name="VCCLCompilerTool"
					Optimization="0"
					Defines="WIN32;_DEBUG"
					MinimalRebuild="TRUE"
					FullRuntimeChecks="FALSE"
					WarnLevel="3"
					SuppressStartupMessage="TRUE"
					DebugInformation="3"/>
				<Tool
					Name="VCCustomBuildTool"/>
				<Tool
					Name="VCLinkerTool"
					IgnoreExportLibrary="TRUE"
					AdditionalInputs="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
					OutputFile="$(OutDir)/Pop3Client.exe"
					LinkIncremental="2"
					SuppressStartupMessage="TRUE"
					GenerateDebug="TRUE"/>
				<Tool
					Name="VCMIDLTool"/>
				<Tool
					Name="VCPostBuildEventTool"/>
				<Tool
					Name="VCPreBuildEventTool"/>
				<Tool
					Name="VCPreLinkEventTool"/>
				<Tool
					Name="VCResourceCompilerTool"/>
				<Tool
					Name="VCSDLTool"/>
			</Configuration>
			<Configuration
				Name="Release|Win32"
				IntermediateDirectory="Release"
				OutputDirectory="Release"
				ConfigurationType="1"
				CharacterSet="2"
				ManagedExtensions="TRUE">
				<Tool
					Name="VCBscMakeTool"/>
				<Tool
					Name="VCCLCompilerTool"
					Optimization="2"
					InlineFunctionExpansion="1"
					Defines="WIN32;NDEBUG"
					MinimalRebuild="FALSE"
					WarnLevel="3"
					SuppressStartupMessage="TRUE"/>
				<Tool
					Name="VCCustomBuildTool"/>
				<Tool
					Name="VCLinkerTool"
					IgnoreExportLibrary="TRUE"
					AdditionalInputs="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
					OutputFile="$(OutDir)/Pop3Client.exe"
					LinkIncremental="1"
					SuppressStartupMessage="TRUE"
					GenerateDebug="FALSE"/>
				<Tool
					Name="VCMIDLTool"/>
				<Tool
					Name="VCPostBuildEventTool"/>
				<Tool
					Name="VCPreBuildEventTool"/>
				<Tool
					Name="VCPreLinkEventTool"/>
				<Tool
					Name="VCResourceCompilerTool"/>
				<Tool
					Name="VCSDLTool"/>
			</Configuration>
		</Settings>
	</Build>
	<Files>
		<Filter
			Name="Source Files"
			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;asm">
			<File
				RelativePath="AssemblyInfo.cpp">
			</File>
			<File
				RelativePath="Pop3Client.cpp">
			</File>
		</Filter>
		<Filter
			Name="Header Files"
			Filter="h;hpp;hxx;hm;inl;inc">
		</Filter>
		<Filter
			Name="Resource Files"
			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
		</Filter>
		<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
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