Click here to Skip to main content
15,892,517 members
Articles / Programming Languages / C#

Step by Step Threads

Rate me:
Please Sign up or sign in to vote.
4.14/5 (8 votes)
31 May 2008CPOL8 min read 65.2K   515   37  
Step by step cross thread communication and thread-safe form control updates.
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.50727</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B5C13057-1D87-455E-BAAF-0C6BC1E5486C}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>ThreadComm</RootNamespace>
    <AssemblyName>ThreadComm</AssemblyName>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="MainThreadForm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="MainThreadForm.Designer.cs">
      <DependentUpon>MainThreadForm.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="MainThreadForm.resx">
      <SubType>Designer</SubType>
      <DependentUpon>MainThreadForm.cs</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
    </None>
    <Compile Include="Properties\Settings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
  </ItemGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer SIRVA
United States United States
SIRVACodeGuy (formerly AWSCodeGuy) has been an IT pro for over ten years.
Starting with an A+ certification, it took him only a few months to get kicked out of hardware and into EDI data analysis, where he learned VBA in MS Excel 97 as a matter of self-preservation ("There's GOTTA be an easier way to do this!").
After a year of that role growing into support of an Access 97 MRP/EDI package, a project came up that required Java, so he set out to learn that, since there was nobody in the company who understood Java. The course at IVY Tech was fun, so he went back for VB.Net 1.0 and SQL Server.
That led to a new job writing Windows applications, where he learned about users who have no clue what they want and the concept of ever-changing specs and features.
A couple years of that led to a position writing web applications with ASP.Net and VB.Net 2.0, and some AJAX, Windows forms in C# 2.0, SQL Server Report Services.
Now working for SIRVA using all sorts of obscure, arcane technology like writing a .Net 3.5 dll which consumes one VB6 COM+ module and is consumed by a different VB6 COM+ module.

Comments and Discussions