TARGETTYPE

Use the TARGETTYPE macro to specify the type of product being built. TARGETTYPE gives the Build utility clues about some of the input files that it should expect. You must include this macro in your Sources file.

When you build a DLL, TARGETTYPE is typically LIBRARY or DYNLINK.

The full list of possible values is as follows.

Value DefinitionProductExtension

PROGRAM

A user-mode program that does not export anything.

.exe

PROGLIB

An executable program that also exports functions for other programs.

.exe

DYNLINK

A dynamic-link library (DLL). This could be a control panel program or any other program that can be dynamically loaded. A dynamic-link library exports functions that other binaries can link to. The DLL switch is passed to the linker to indicate that the build product isnot a stand-alone .exe. When you build a dynamic-link library, you might also need to set the TARGETEXT macro.

.dll

LIBRARY

A user-mode import library that contains code that will be linked with other code. This is a library of objects, not an import library. It contains routines to which other components can link statically. (An import library is built as a side effect of building a dynamic-link library. Whenever you build a DLL, you get a .lib file and a .dll file. When you build a library, you just get a .lib file.)

.lib

DRIVER_LIBRARY

A kernel-mode import library. This is the kernel-mode equivalent of LIBRARY. It contains routines to which other kernel-mode components can link statically.

.lib

DRIVER

A kernel-mode driver.

.sys

EXPORT_DRIVER

A kernel-mode driver that also exports functions for other drivers.

.sys

MINIPORT

A kernel-mode driver that does not link with ntoskrnl.lib or hal.lib.

.sys

GDI_DRIVER

A kernel-mode graphics driver that links with win32k.sys.

.dll

BOOTPGM

A kernel-mode driver.

.exe

HAL

The hardware abstraction layer.

.dll

NOTARGET

Specifies that no target should actually be created. Use this if you have a directory that needs some processing, but you do not want a binary to be generated.


 

 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 如下是一个标准的 ControlTemplate,它的 TargetType 为 ContentControl,在 WPF 中使用: ```xml <ControlTemplate TargetType="{x:Type ContentControl}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}"> <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/> </Border> </ControlTemplate> ``` 这个 ControlTemplate 定义了一个 Border 元素,它的背景、边框画刷和边框粗细都是由 ContentControl 绑定的。它的子元素是 ContentPresenter,它的内容、内容模板都是由 ContentControl 绑定的。 ### 回答2: 一个符合标准的WPF中的ControlTemplate,其TargetType为ContentControl,可以被如下定义和实现: ```xml <Style TargetType="{x:Type ContentControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ContentControl}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Content="{TemplateBinding Content}" /> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> ``` 这个ControlTemplate的目标类型是ContentControl,使用了一个Border作为容器,用于设置边框背景和边框样式。内部有一个ContentPresenter,用于呈现ContentControl的内容。ContentPresenter的水平对齐和垂直对齐方式都设置为居中,以确保内容在容器中居中显示。 在实际使用时,可以将此ControlTemplate应用于任何TargetType为ContentControl的控件,例如: ```xml <ContentControl Template="{StaticResource StandardContentControlTemplate}"> <!-- 这里放置需要呈现的内容 --> </ContentControl> ``` 通过这个标准的ControlTemplate,可以统一ContentControl的外观样式,增强应用界面的一致性和美观性。 ### 回答3: 当我们在WPF中使用ControlTemplate时,"TargetType="{x:Type ContentControl}"定义的模板将适用于ContentControl及其所有派生类的控件。 以下是一个WPF中标准的,TargetType="{x:Type ContentControl}"的控件模板的示例: ```xml <ControlTemplate TargetType="{x:Type ContentControl}"> <Border BorderBrush="Black" BorderThickness="1" Background="LightGray" CornerRadius="5"> <!-- 内容控件的内容将放置在这里 --> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> </Border> </ControlTemplate> ``` 在这个示例中,我们使用了一个Border控件来包裹ContentControl的内容。该Border具有黑色边框、灰色背景和圆角边框。 ContentPresenter用于呈现ContentControl中的内容,它被设置为水平和垂直居中,使得内容在Border中居中显示。 使用这个模板时,可以通过将模板应用到ContentControl的Style中来覆盖默认模板。例如: ```xml <ContentControl Content="Hello, World!" Style="{StaticResource MyContentControlStyle}" /> ``` 其中,MyContentControlStyle是已定义的样式,它引用了上述的标准模板。 这样,ContentControl将使用定义的控件模板进行呈现,显示带有边框和背景的内容。 希望这个回答能够对你有所帮助!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值