VB ActiveX control (VBActiveX)

The code sample demonstrates creating an ActiveX control in VB

VB.NET (73.6 KB)
 
 
 
 
 
3 Star
(4)
11,968 times
Add to favorites
3/2/2012
E-mail Twitter del.icio.us Digg Facebook
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{6FE5AC6D-E08F-4418-86D3-3EC7899E2A38}</ProjectGuid>
    <OutputType>Library</OutputType>
    <RootNamespace>VBActiveX</RootNamespace>
    <AssemblyName>VBActiveX</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>Windows</MyType>
    <Win32Resource>VBActiveX.res</Win32Resource>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <OptionExplicit>On</OptionExplicit>
    <OptionCompare>Binary</OptionCompare>
    <OptionStrict>Off</OptionStrict>
    <OptionInfer>On</OptionInfer>
    <TargetFrameworkSubset>
    </TargetFrameworkSubset>
    
    
    
    
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>..\Debug\</OutputPath>
    <DocumentationFile>VBActiveX.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
    <RegisterForComInterop>true</RegisterForComInterop>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>..\Release\</OutputPath>
    <DocumentationFile>VBActiveX.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
    <RegisterForComInterop>true</RegisterForComInterop>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Windows.Forms" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="ActiveXCtrlHelper.vb">
      <SubType>Component</SubType>
    </Compile>
    <Compile Include="My Project\AssemblyInfo.vb" />
    <Compile Include="My Project\Application.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My Project\Resources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My Project\Settings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
    <Compile Include="VBActiveXCtrl.Designer.vb">
      <DependentUpon>VBActiveXCtrl.vb</DependentUpon>
    </Compile>
    <Compile Include="VBActiveXCtrl.vb">
      <SubType>UserControl</SubType>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="My Project\Resources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
    <EmbeddedResource Include="VBActiveXCtrl.resx">
      <DependentUpon>VBActiveXCtrl.vb</DependentUpon>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="My Project\Application.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My Project\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
    <None Include="VBActiveX.manifest" />
  </ItemGroup>
  <ItemGroup>
    <Service Include="{94E38DFF-614B-4CBD-B67C-F211BB35CE8B}" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="ReadMe.txt" />
    <Content Include="VBActiveX.bmp" />
    <Content Include="VBActiveX.rc" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.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>
  -->
  <PropertyGroup>
    <PreBuildEvent>@echo.
IF EXIST "$(DevEnvDir)..\..\..\Microsoft SDKs\Windows\v6.0A\bin\rc.exe" ("$(DevEnvDir)..\..\..\Microsoft SDKs\Windows\v6.0A\bin\rc.exe" /r "$(ProjectDir)VBActiveX.rc") ELSE (IF EXIST "$(DevEnvDir)..\..\SDK\v2.0\Bin\rc.exe" ("$(DevEnvDir)..\..\SDK\v2.0\Bin\rc.exe" /r "$(ProjectDir)VBActiveX.rc") ELSE (IF EXIST "$(DevEnvDir)..\Tools\Bin\rc.exe" ("$(DevEnvDir)..\Tools\Bin\rc.exe" /r "$(ProjectDir)VBActiveX.rc") ELSE (IF EXIST "$(DevEnvDir)..\..\VC\Bin\rc.exe" ("$(DevEnvDir)..\..\VC\Bin\rc.exe" /r "$(ProjectDir)VBActiveX.rc") ELSE (IF EXIST "C:\Program Files (x86)\microsoft sdks\windows\v6.0A\bin\rc.exe" ("c:\Program Files (x86)\microsoft sdks\windows\v6.0A\bin\rc.exe" /r "$(ProjectDir)VBActiveX.rc") ELSE (IF EXIST "C:\Program Files\microsoft sdks\windows\v6.0A\bin\rc.exe" ("c:\Program Files\microsoft sdks\windows\v6.0A\bin\rc.exe" /r "$(ProjectDir)VBActiveX.rc") ELSE (@Echo Unable to find rc.exe, using default manifest instead))))))
@echo.</PreBuildEvent>
  </PropertyGroup>
</Project>