Documentos de Académico
Documentos de Profesional
Documentos de Cultura
VS2005 DeviceDev Es-Es
VS2005 DeviceDev Es-Es
El contenido de este documento se ha retirado y ya no se actualiza o admite. Algunos vínculos podrían no funcionar. El contenido retirado
representa la versión más reciente actualizada de este contenido.
Desarrollo para Smart Device
Seguridad
El aspecto de conexión remota de aplicaciones de dispositivos agrega temas adicionales relacionados con la seguridad. Para
obtener más información, consulte Seguridad en los proyectos de dispositivos, Seguridad en .NET Compact Framework y
Seguridad del código nativo y del código de .NET Framework.
Establecer conexión entre puertos de soluciones existentes
Vea la siguiente información para obtener detalles sobre el establecimiento de conexión entre puertos y la migración:
Crear y desarrollar proyectos de dispositivos administrados
Asistente para actualización de eMbedded Visual C++ a Visual Studio 2005
Dispositivo y escritorio
Se utiliza el mismo entorno de Visual Studio que se utiliza para desarrollar aplicaciones de escritorio, pero surgen algunas
diferencias palpables al establecer como destino determinados dispositivos. Por ejemplo:
El entorno de Visual Studio proporciona herramientas adicionales para conectarse y realizar depuraciones en un
dispositivo.
Aparte de seleccionar un tipo de proyecto y una plantilla cuando se crea un proyecto, debe seleccionarse un dispositivo
en el que se ejecutará y depurará la aplicación. El dispositivo puede ser un dispositivo físico conectado al equipo de
desarrollo, un dispositivo conectado en red o un emulador de dispositivos que se ejecute en el equipo de desarrollo.
El número de clases y de miembros de éstas difieren de los disponibles cuando se desarrollan aplicaciones para
escritorio. En proyectos administrados que utilizan .NET Compact Framework, hay pocas clases que se encuentren
disponibles para dispositivos y el complemento de las clases normalmente difiere entre plataformas. Sucede lo mismo
con los proyectos nativos, en lo que sólo se encuentra disponible un subconjunto de API de Windows, clases MFC o
componentes ATL. Es posible determinar el tipo de clases disponibles con tan sólo ver la documentación, utilizar
IntelliSense o utilizar el Examinador de objetos de Visual Studio mientras que un determinado proyecto se encuentre
activo.
Como ocurre con las aplicaciones de escritorio, puede obtener acceso al código nativo mediante la invocación de la
plataforma. .NET Compact Framework ofrece una compatibilidad limitada con la interoperabilidad COM. No acepta la
creación de objetos COM en el código administrado ni la interoperabilidad con los controles ActiveX.
Algunos elementos del lenguaje pueden diferir, por ejemplo, no se aceptan todas las palabras clave de Visual Basic que
se utilizan en la programación para escritorio.
Algunos miniprogramas de código proporcionados en la documentación de Visual Studio para proyectos de escritorio
pueden generar errores de ejecución en proyectos de dispositivos.
Hay ciertas consideraciones del diseño, como el factor de la forma del dispositivo, el gasto de energía, limitaciones de la
memoria y otros detalles, que no plantean dificultades en el desarrollo para escritorio.
Recursos adicionales
Para obtener más información, visite el Mobile Developer Center.
Vea también
Otros recursos
Introducción a los proyectos para Smart Device
Desarrollo para Smart Device
Código interpretado X
Código administrado X X
Smartphone 2002 X
Versión de software de Window Windows Mobile 5.0 En ROM (1.0 SP3) Usuario que se puede instalar
s Mobile
Windows Mobile 2003 (segunda En ROM (1.0 SP2) Usuario que se puede instalar (sólo
edición) Pocket PC)
Windows Mobile 2003 En ROM (1.0 SP2) Usuario que se puede instalar (sólo
Pocket PC)
Smartphone 2002
Windows Mobile 2003 Usuario que se puede instalar (sólo Pocke Usuario que se puede inst N/A En R En ROM
(segunda edición) t PC) alar (sólo Pocket PC) OM
Windows Mobile 2003 Usuario que se puede instalar (sólo Pocke Usuario que se puede inst N/A En R En ROM
t PC) alar (sólo Pocket PC) OM
Pocket PC 2000 N/A Usuario que se puede inst N/A En R En ROM (la mayoría d
alar (sólo Pocket PC) OM e los dispositivos)
* En Windows Mobile 5.0, CEDB se encuentra en la memoria ROM pero está en desuso. En su lugar, los desarrolladores
deberían utilizar EDB.
Notas
Compruebe con el fabricante del dispositivo la actualización relacionada con un determinado dispositivo en una versión
posterior de Windows CE o Windows Mobile. Microsoft no proporciona actualizaciones para determinados dispositivos
destinados a usuarios finales.
Las ediciones de Visual Studio 2005 Express no incluyen compatibilidad con respecto a proyectos Smart Device.
Ya no se admiten las herramientas de eMbedded Visual Basic. El tiempo de ejecución de eMbedded Visual Basic ya no se
encuentra en la memoria ROM de dispositivos.
Es posible descargar eMbedded Visual C++ 4.0 y eMbedded Visual Basic 4.0 desde Mobile Developer Center.
La versión 1.0 de .NET Compact Framework, en caso de que todavía no se encuentre en la memoria ROM, se puede
instalar en la memoria ROM de dispositivos Pocket PC 2000, 2002, 2003 y SE 2003. En lo que concierne a la versión 2.0,
si todavía no se encuentra en la memoria ROM, se puede instalar en la memoria RAM o en un almacén persistente de
Pocket PC 2003, Windows CE 5.0 y Windows Mobile 5.0.
La versión actual de Compact Framework es la 2.0, disponible como instalación en memoria RAM en Mobile Developer
Center.
Vea también
Conceptos
Actualizar proyectos creados con herramientas antiguas
Otros recursos
Introducción a los proyectos para Smart Device
Desarrollo para Smart Device
Mostrar información sobre identificadores del montón e indicadores sobre cada proceso que se ejecuta Walker de montón re
en un dispositivo de destino moto
Mostrar información sobre cada proceso que se ejecuta en un dispositivo de destino Visor de proceso re
moto
Mostrar mensajes recibidos por ventanas asociadas a aplicaciones que se ejecutan en un dispositivo de Spy remoto
destino
Capturar una imagen de la pantalla en formato de archivo de mapa de bits (.bmp) de un dispositivo de d Zoom para acercar r
estino emoto
Vea también
Otros recursos
Introducción a los proyectos para Smart Device
Desarrollo para Smart Device
Para obtener más información sobre el uso de Visual Studio 2005 para convertir un proyecto de eVB, vea los temas siguientes:
Migrating eVB File Controls to Visual Basic .NET
Migrating eVB Forms to Visual Basic .NET
Migrar proyectos administrados de Visual Studio .NET 2003 a Visual Studio 2005
Los proyectos para dispositivos inteligentes de Visual C# y Visual Basic desarrollados en Visual Studio .NET 2003 se pueden
importar a Visual Studio 2005. El Asistente de conversión de Visual Studio realiza los cambios necesarios en los proyectos.
Actualizar proyectos de dispositivos en 2002 a dispositivos en 2003
Para obtener más información sobre cómo actualizar proyectos de Windows Mobile 2000 a Windows Mobile 2003, vea
Windows Mobile Platform Migration FAQ for Developers.
Vea también
Conceptos
Capacidades de dispositivos y herramientas de desarrollo necesarias
Otros recursos
Introducción a los proyectos para Smart Device
Migrar al entorno de eVC 4.0
Desarrollo para Smart Device
Biblioteca de controles Pocket PC 2003, Windows C Proyecto para crear controles de .NET Compact Framework 2.0.
E 5.0
Biblioteca de clases Pocket PC 2003, Windows C Proyecto para crear una biblioteca de clases (DLL) de .NET Compact Fra
E 5.0 mework 2.0.
Aplicación de consola Pocket PC 2003, Windows C Proyecto para crear una aplicación no gráfica de .NET Compact Framew
E 5.0 ork 2.0.
Proyecto vacío Pocket PC 2003, Windows C Proyecto vacío para crear una aplicación de .NET Compact Framework 2.
E 5.0 0.
Aplicación de dispositiv Pocket PC 2003, Smartphon Proyecto para crear una aplicación de Windows Forms de .NET Compact
o (1.0) e 2003 Framework 1.0.
Biblioteca de clases (1.0) Pocket PC 2003, Smartphon Proyecto para crear una biblioteca de clases (DLL) de .NET Compact Fra
e 2003 mework 1.0.
Aplicación de consola (1 Pocket PC 2003, Smartphon Proyecto para crear una aplicación no gráfica de .NET Compact Framew
.0) e 2003 ork 1.0.
Proyecto vacío (1.0) Pocket PC 2003, Smartphon Proyecto vacío para crear una aplicación de .NET Compact Framework 1.
e 2003 0.
Visual C++
Nombre de plantilla Dispositivos compatibles Comentarios
Proyectos ATL para Sma Pocket PC 2003, Smartphone 20 Proyecto para crear una aplicación utilizando Active Template Librar
rt Device 03, Windows CE 5.0 y.
Proyecto para Smart De Pocket PC 2003, Smartphone 20 Proyecto para crear una aplicación utilizando la biblioteca Microsoft
vice MFC 03, Windows CE 5.0 Foundation Class.
Control ActiveX para Sm Pocket PC 2003, Smartphone 20 Proyecto para crear un control ActiveX utilizando la biblioteca Micro
art Device MFC 03, Windows CE 5.0 soft Foundation Class.
DLL para Smart Device Pocket PC 2003, Smartphone 20 Proyecto para crear una biblioteca de vínculos dinámicos utilizando
MFC 03, Windows CE 5.0 la biblioteca Microsoft Foundation Class.
Proyecto Win32 Pocket PC 2003, Smartphone 20 Proyecto para la creación de una aplicación Win32.
03, Windows CE 5.0
Vea también
Conceptos
Seleccionar un lenguaje de programación
Desarrollo para Smart Device
Visual C++
Visual C++ es el lenguaje de desarrollo que se prefiere para Smart Devices cuando el rendimiento es fundamental o a la hora
de desarrollar aplicaciones de nivel de sistema, controladores de dispositivos o complementos de pantalla Home o Today.
Visual C++ no admite .NET Compact Framework, pero en su lugar proporciona un subconjunto del conjunto API Win32. Esto
es posible para aplicaciones escritas en código de C# administrado o de Visual Basic para tener acceso a código de C++
contenido en archivos DLL mediante interoperabilidad.
Para obtener más información sobre cómo desarrollar en Visual C++, vea:
C/C++ Languages
Vea también
Otros recursos
Introducción a los proyectos para Smart Device
Desarrollo para Smart Device
En esta sección
Tecnología de máscara (dispositivos)
Describe el archivo de definición de máscara XML y los requisitos de los archivos de gráficos para máscaras.
Cómo: Crear archivos de máscara (dispositivos)
Describe los pasos para crear una máscara simple.
Cómo: Cambiar las características visuales de las máscaras (dispositivos)
Describe las modificaciones que pueden realizarse en el archivo de definición de máscara y que afectan la barra de títulos del
emulador, la ubicación y la dimensión del área de visualización, y si la máscara aparecerá o no en un marco o en una
transparencia.
Cómo: Procesar los eventos del mouse (ratón) (dispositivos)
Describe el uso de la asignación de colores para especificar las áreas de la máscara, también denominadas zonas interactivas,
que pueden responder a eventos del mouse.
Cómo: Exponer la información sobre herramientas (dispositivos)
Describe cómo proporcionar información sobre herramientas para las zonas interactivas de las máscaras.
Cómo: Utilizar máscaras con el emulador de dispositivos
Describe las opciones disponibles en la interfaz de usuario del emulador de dispositivos (incluida la elección de la máscara),
cómo guardar la máscara con una imagen de SO y cómo mostrar u ocultar la información sobre herramientas.
Cómo: Utilizar máscaras con Visual Studio 2005 (dispositivos)
Describe las opciones disponibles en la interfaz de usuario de Visual Studio: configurar las opciones predeterminadas,
especificar la resolución, habilitar la rotación, etc.
Detalles de un archivo de definición de máscara (dispositivos)
Describe los elementos individuales, tanto los necesarios como los opcionales, que aparecen en un archivo de definición de
máscara y ofrece valores de ejemplo.
Ejemplo de archivo de definición de máscara (dispositivos)
Presenta un archivo de definición de máscara completo.
Vea también
Otros recursos
Consideraciones de diseño para el desarrollo de aplicaciones para Smart Device
Centro para desarrolladores de Mobile
Desarrollo para Smart Device
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
Nota
Los cuadros de diálogo y comandos de menú que se ven pueden diferir de los descritos en la Ayuda, en función de la configu
ración activa o la edición. Para cambiar la configuración, elija la opción Importar y exportar configuraciones en el menú H
erramientas. Para obtener más información, vea Valores de configuración de Visual Studio.
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
<button
toolTip="Soft Key 1"
onClick="DOWN:0x5b 0x70 UP:0x5b"
mappingColor="0xF26C4F"
/>
<button
toolTip="Power"
onPressAndHold="0x75"
mappingColor="0xED145B"
/>
<button
toolTip="Soft Key 1"
onClick="DOWN:0x5b 0x70 UP:0x5b"
mappingColor="0xF26C4F"
/>
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
Nota
Los cuadros de diálogo y comandos de menú que se ven pueden diferir de los descritos en la Ayuda, en función de la configu
ración activa o la edición. Para cambiar la configuración, elija la opción Importar y exportar configuraciones en el menú H
erramientas. Para obtener más información, vea Valores de configuración de Visual Studio.
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
Etiqueta <view> Contiene el esquema de una máscara del emulador. Sólo puede utilizar una etiqueta <view> por cada etiquet
a <skin>.
Elementos disp Especifica la posición dentro de la ventana de la máscara del emulador en la que ubicar la ventana que contie
layPosX="10" y ne el área de presentación del emulador . Para que el área de presentación no sea visible, seleccione coorden
displayPosY="1 adas fuera de la pantalla.
49"
Elementos disp Especifica el ancho y alto del área de presentación del emulador. Para el ancho, elija un entero entre 80 y 102
layWidth="272" 4 que sea divisible por 8. Para el alto, elija un entero entre 64 y 768.
y displayHeigh
t="224"
Elemento displ Especifica la profundidad de color del área de presentación del emulador. Para la profundidad de color, elija 8
ayDepth="8" , 16 ó 32.
Elemento norma Especifica el archivo de imágenes normal de la máscara del emulador, que es obligatorio. El archivo de imáge
lImage="up.bmp nes normal indica el tamaño de la ventana y el aspecto de la máscara del emulador.
"
Elemento mappi Especifica el archivo de asignación para la máscara del emulador. El archivo de asignación es un archivo opci
ngImage="map.b onal que define las regiones ocupadas por los botones en la máscara del emulador.
mp"
Elemento downI Especifica el archivo de imagen correspondiente a un botón presionado para la máscara del emulador. El arch
mage="down.bmp ivo de imagen de botón presionado es un archivo opcional que especifica el aspecto que adoptan los botones
"
de la máscara del emulador al presionarlos.
Elemento mappi Especifica en el archivo de asignación el color RGB que se va a utilizar para el botón. Todos los píxeles que tie
ngColor="0x00F nen este color en la imagen de asignación representan el área de la máscara del emulador en la que es posibl
F00"
e hacer clic para este botón en particular. Esta área se comporta como una máscara a través de la cual, al pres
ionar el botón en cuestión, se muestra el archivo de imagen de botón presionado.
Elemento toolT Opcional. Especifica el texto que aparecerá al situar el puntero sobre el botón.
ip="This is my
ToolTip."
onClick=" DOWN Opcional. Especifica las teclas del teclado que pasaran como presionadas al motor cuando se presione un bot
:Key_LeftShift
ón. Utilice valores enteros o hexadecimales que correspondan a un código de exploración de teclado sin form
Key_Z ato ("raw keyboard scan code").
0x00000015
UP: Key_LeftSh
ift
Key_A"
<button Especifica los eventos de teclado que se van a repetir mientras se presiona un botón en la máscara del emula
toolTip="Soft dor. Si se especifica KeyEvent, el diseñador genera el código del botón. Si se especifica Comment, se agrega al c
Key 1" ódigo generado en forma de comentario. Se utiliza información sobre herramientas a modo de comentario d
onPressAndHold e forma predeterminada.
="0x3B"
Esta característica admite todos los códigos de tecla excepto SHUTDOWN.
mappingColor="
0xF26C4F"
KeyEvent="F1"
Comment="Not h
andled when me
nu
is present."
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
Vea también
Otros recursos
Personalizar máscaras (dispositivos)
Desarrollo para Smart Device
Vea también
Otros recursos
Conectar Smart Devices a equipos de desarrollo
Desarrollo para Smart Device
9. Una vez realizados los pasos para la asociación de ActiveSync, haga clic en Explorar en la barra de herramientas de
ActiveSync para obtener acceso al sistema de archivos del emulador de Smartphone.
Nota
Cuando desee usar un emulador conectado a Visual Studio utilizando ActiveSync, utilice el destino del dispositivo, no el
del emulador, de la plataforma correspondiente.
Vea también
Otros recursos
Conectar Smart Devices a equipos de desarrollo
Desarrollo para Smart Device
Nuevas características
Las características siguientes están disponibles en Visual Studio 2005.
Característica Detalles
*Delimitar controles en formularios Windows Cómo: Delimitar controles en formularios Windows For
ms
Generación de archivos CAB con proyectos de instalación e impleme Información general sobre el empaquetado de solucione
ntación de Visual Studio. Este proceso elimina la necesidad de perso s para dispositivos
nalizar el archivo .inf manualmente.
Filtrar las propiedades, los métodos y los eventos no compatibles. La característica incluye IntelliSense con filtro, un paso de
comprobación de generación y capacidad para convertir l
os controles no compatibles.
*Acoplar controles en formularios Windows Forms Cómo: Acoplar controles en formularios Windows Forms
*Compatibilidad con factores de forma, incluidas la orientación y la r Propiedades de factor de forma (Cuadro de diálogo, Disp
esolución. ositivos)
*Ajustar automáticamente
Máscara de formularios con creación de código Propiedades de factor de forma (Cuadro de diálogo, Disp
ositivos)
Para la versión 1,0 de .NET Compact Framework Compatibilidad con Smartphone 2003 y Pocket PC 2003
Cambio de plataforma con el mismo código fuente Cómo: Compartir código fuente entre plataformas (Dispo
sitivos)
Vea también
Otros recursos
Lo nuevo en .NET Compact Framework 2.0
Lo nuevo en el entorno de desarrollo
Programación para dispositivos con .NET Compact Framework
Desarrollo para Smart Device
Interoperabilidad COM
Los desarrolladores de aplicaciones de escritorio utilizan la interoperabilidad COM para hacer uso de los objetos COM
existentes mientras hacen la transición a .NET Framework a su propio ritmo. Los proyectos de dispositivo sólo admiten ciertos
escenarios para la interoperabilidad COM. Para obtener más información, vea Interoperabilidad COM para dispositivos.
Depuración
La asociación a procesos en ejecución difiere ligeramente del escritorio. Para obtener más información, vea Cómo: Conectar a
procesos de dispositivos administrados.
Vea también
Referencia
Referencia del lenguaje Visual Basic para dispositivos
System.IO Namespace
Decidir qué tecnologías y herramientas utilizar
Referencia de My
Conceptos
Enlace en tiempo de compilación y en tiempo de ejecución
Me, My, MyBase y MyClass en Visual Basic
Interoperabilidad COM para dispositivos
Otros recursos
Acceso a archivos con Visual Basic
Programación de .NET Framework en Visual Studio
Desarrollo para Smart Device
LinkLabel Sí No
Botón Sí No
TextBox Sí Sí
MainMenu Sí Sí
CheckBox Sí Sí
RadioButton Sí No
PictureBox Sí Sí
Panel Sí Sí
DataGrid Sí No
BindingSource. Sí No
ListBox Sí No
ComboBox Sí Sí
ListView Sí Sí
TreeView Sí Sí
TabControl Sí No
DateTimePicker Sí No
MonthCalendar Sí No
HScrollBar Sí Sí
VScrollBar Sí Sí
Temporizador Sí Sí
Splitter Sí No
DomainUpDown Sí No
NumericUpDown Sí No
TrackBar Sí No
ProgressBar Sí Sí
ImageList Sí Sí
ContextMenu Sí No
ToolBar Sí No
StatusBar Sí No
OpenFileDialog Sí No
SaveFileDialog Sí No
WebBrowser Sí No
InputPanel Sí No
Notificación Sí No
DocumentList Sí No
Es posible compartir código fuente entre plataformas. Para obtener más información, vea Cómo: Compartir código fuente
entre plataformas (Dispositivos).
Vea también
Tareas
Cómo: Actualizar proyectos a las versiones más recientes de .NET Compact Framework
Otros recursos
Programación para dispositivos con .NET Compact Framework
Desarrollo para Smart Device
Escenarios no compatibles
Los escenarios siguientes no se admiten en Visual Studio 2005:
Hacer referencia a un componente COM ActiveX existente desde dentro de un proyecto administrado
Objetos COM con componentes secundarios que no son del sistema
Objetos COM a los que se hace referencia como objetos comerciales desde dentro del Asistente de DataSource.
Vea también
Tareas
Tutorial: Hola a todos: Ejemplo de interoperabilidad COM para Smart Devices
Tutorial: Depurar una solución que incluye código administrado y código nativo
Conceptos
Información general sobre la interoperabilidad COM
Contenedor al que se puede llamar en tiempo de ejecución
Calcular referencias de interfaces seleccionadas
Otros recursos
Interoperabilidad COM en aplicaciones .NET Framework
Programación para dispositivos con .NET Compact Framework
Interoperabilidad en .NET Compact Framework
Desarrollo para Smart Device
Vea también
Otros recursos
Crear y desarrollar proyectos de dispositivos administrados
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Utilizar el componente HardwareButton
Referencia
HardwareButton
Otros recursos
Crear y desarrollar proyectos de dispositivos administrados
Desarrollo para Smart Device
5. En el diseñador, haga clic con el botón secundario del mouse en el formulario o la máscara y, a continuación, seleccione
Girar a la izquierda o Girar a la derecha para hacer rotar la máscara.
El hecho de que gire el formulario cuando gira el dispositivo depende de la plataforma actual y de los valores de
configuración de las propiedades del formulario, de la siguiente manera:
Smartphone: el formulario siempre gira cuando gira el dispositivo.
Pocket PC: el formulario gira de forma predeterminada cuando gira el dispositivo. Para evitar que el formulario gire
con el dispositivo, establezca la propiedad WindowState del formulario en Normal y la propiedad
FormBorderStyle en None.
Windows CE: el formulario no gira de forma predeterminada cuando gira el dispositivo. Para que el formulario gire
con el dispositivo, establezca la propiedad WindowState en Maximized.
Para cambiar la resolución
1. En el menú Herramientas, haga clic en Opciones, haga clic Herramientas de dispositivo y, a continuación, en
Factores de forma.
2. Seleccione el factor de forma (por ejemplo, Retrato de Pocket PC 2003) para el formulario de su proyecto y, a
continuación, haga clic en Propiedades.
3. En el cuadro de diálogo Propiedades del factor de forma, establezca la resolución vertical y horizontal.
4. Haga clic en Aceptar para cerrar el cuadro de diálogo Propiedades del factor de forma y haga clic en Aceptar de
nuevo para cerrar el cuadro de diálogo Opciones.
Nota
Si el diseñador estaba abierto cuando se cambiaron las opciones, ciérrelo y ábralo de nuevo para que los cambios surta
n efecto.
Vea también
Referencia
Propiedades de factor de forma (Cuadro de diálogo, Dispositivos)
Factores de forma, Herramientas de dispositivo, Opciones (Cuadro de diálogo)
Desarrollo para Smart Device
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Runtime.InteropServices;
namespace MobileSoundPInvoke
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.MainMenu mainMenu1;
public Form1()
{
InitializeComponent();
PlaySound(".\\sound.wav");
}
this.Text = "Form1";
}
#endregion
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
static void Main()
{
Application.Run(new Form1());
}
private enum Flags
{
SND_SYNC = 0x0000,
SND_ASYNC = 0x0001,
SND_NODEFAULT = 0x0002,
SND_MEMORY = 0x0004,
SND_LOOP = 0x0008,
SND_NOSTOP = 0x0010,
SND_NOWAIT = 0x00002000,
SND_ALIAS = 0x00010000,
SND_ALIAS_ID = 0x00110000,
SND_FILENAME = 0x00020000,
SND_RESOURCE = 0x00040004
}
[DllImport("CoreDll.DLL", EntryPoint = "PlaySound", SetLastError = true)]
private extern static int MobilePlaySound(string szSound, IntPtr hMod, int flags);
public void PlaySound(string fileName)
{
MobilePlaySound(fileName, IntPtr.Zero, (int)(Flags.SND_ASYNC | Flags.SND_FILENA
ME));
}
}
}
Compilar el código
Cree un nuevo proyecto para la aplicación Smartphone de C# en Visual Studio y póngale MobileSoundPInvoke como
nombre.
Copie el código del ejemplo anterior y péguelo en el archivo Form1.cs del proyecto MobileSoundPInvoke en una
aplicación de la consola.
Programación eficaz
Hay que asegurarse de que se pasan los parámetros adecuados al a función C MobilePlaySound (string szSound,
IntPtr hMod, int flags), incluidos la ruta y el nombre del archivo para el archivo .wav.
Seguridad
Para obtener más información sobre seguridad, vea .NET Framework Security.
Vea también
Tareas
Ejemplo de tecnología de invocación de plataformas
Otros recursos
Ejemplos de dispositivos inteligentes
Tutoriales sobre dispositivos inteligentes
Utilizar un elemento PInvoke explícito en C++ (Atributo DllImport)
Crear una biblioteca de P/Invocar
http://pinvoke.net/
Desarrollo para Smart Device
Vea también
Referencia
SqlCeResultSet
Conceptos
Conjuntos de resultados y conjuntos de datos (Dispositivos)
Otros recursos
Datos en proyectos de dispositivos administrados
Desarrollo para Smart Device
En esta sección
Cómo: Crear una base de datos (Dispositivos)
Cómo: Cambiar la cadena de conexión en tiempo de diseño (Dispositivos)
Cómo: Cambiar la cadena de conexión en tiempo de ejecución (Dispositivos)
Cómo: Administrar contraseñas para bases de datos (Dispositivos)
Cómo: Reducir y reparar una base de datos (Dispositivos)
Cómo: Agregar una base de datos a un proyecto de dispositivos
Cómo: Administrar tablas en una base de datos (Dispositivos)
Cómo: Administrar columnas en una base de datos (Dispositivos)
Cómo: Administrar índices en una base de datos (Dispositivos)
Cómo: Obtener una vista previa de datos en una base de datos (Dispositivos)
Cómo: Crear consultas parametrizadas (Dispositivos)
Cómo: Crear aplicaciones Principal-Detalle (Dispositivos)
Cómo: Agregar botones de exploración (Dispositivos)
Cómo: Conservar cambios de datos en la base de datos (Dispositivos)
Cómo: Generar código SqlCeResultSet (Dispositivos)
Cómo: Agregar un objeto comercial como origen de datos (Dispositivos)
Cómo: Agregar un servicio Web como origen de datos (Dispositivos)
Cómo: Agregar una base de datos de SQL Server como origen de datos (Dispositivos)
Cómo: Generar vistas de resumen y edición para aplicaciones de datos (Dispositivos)
Vea también
Conceptos
Conectarse a datos en Información general de Visual Studio
Otros recursos
SQL Server Mobile Edition Books Online Home Page
Datos en proyectos de dispositivos administrados
Desarrollo para Smart Device
Cómo: Crear aplicaciones Principal-Detalle (Dispositi Cómo: Administrar columnas en una base de datos (Dispositivos)
vos)
Cómo: Crear consultas parametrizadas (Dispositivos) Cómo: Administrar contraseñas para bases de datos (Dispositivos)
Cómo: Generar código SqlCeResultSet (Dispositivos) Cómo: Obtener una vista previa de datos en una base de datos (Dispositi
vos)
Cómo: Reducir y reparar una base de datos (Disposit Cómo: Agregar una base de datos a un proyecto de dispositivos
ivos)
Cómo: Administrar tablas en una base de datos (Dis Cómo: Administrar índices en una base de datos (Dispositivos)
positivos)
Cómo: Agregar botones de exploración (Dispositivos Cómo: Conservar cambios de datos en la base de datos (Dispositivos)
)
Vea también
Conceptos
SQL Server Compact Edition con .NET Compact Framework
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Instalar bases de datos de ejemplo
Otros recursos
Create Database Dialog (SQL Server Mobile)
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
El diseñador detecta automáticamente la relación principal-detalle a partir de las restricciones FOREIGN KEY. Para
obtener más información, consulte Tutorial: Aplicación Principal-Detalle para una base de datos.
4. Ajuste los controles en el formulario para adaptarlos a su aplicación.
Vea también
Tareas
Tutorial: Aplicación Principal-Detalle para una base de datos
Cómo: Instalar bases de datos de ejemplo
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Agregar una consulta parametrizada a un formulario en una aplicación para Windows
Tutorial: Aplicación de consulta parametrizada
Cómo: Instalar bases de datos de ejemplo
Referencia
Generador de criterios de búsqueda (cuadro de diálogo)
Conceptos
Herramientas de diseño de consultas y vistas
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Instalar bases de datos de ejemplo
Otros recursos
Column Properties
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
En los siguientes pasos de ejemplo se da por hecho que hay una aplicación de formularios Windows Forms de Pocket PC
abierta.
El procedimiento siguiente se ha actualizado para SP1 de Visual Studio 2005.
La base de datos instalada varía en función de la versión de Visual Studio que haya instalado:
Microsoft SQL Server Mobile Edition (Visual Studio 2005)
Microsoft SQL Server 2005 Compact Edition (SP1 de Visual Studio 2005)
Para establecer una contraseña al crear una base de datos
1. En el menú Datos, haga clic en Agregar nuevo origen de datos.
2. En la página Elegir un tipo de origen de datos, haga clic en Base de datos y luego en Siguiente.
3. En la página Elegir la conexión de datos, haga clic en Nueva conexión para abrir el cuadro de diálogo Agregar
conexión.
4. Haga clic sucesivamente en Cambiar, Microsoft SQL Server Mobile Edition y Aceptar.
O bien
Haga clic sucesivamente en Cambiar, Microsoft SQL Server Compact Edition y Aceptar.
5. En el cuadro de diálogo Agregar conexión, haga clic en Mi PC.
6. Haga clic en Crear.
7. En el cuadro de diálogo Crear base de datos de SQL Server 2005 Mobile Edition, escriba la ruta completa de la nueva
base de datos (por ejemplo, c:\MiBaseDeDatos.sdf).
O bien
En el cuadro de diálogo Crear base de datos de Microsoft SQL Server Compact Edition, escriba la ruta completa de
la nueva base de datos (por ejemplo, c:\MiBaseDeDatos.sdf).
8. En los cuadros Contraseña nueva y Confirmar contraseña, escriba una contraseña para la nueva base de datos y, a
continuación, haga clic en Aceptar.
Para cambiar una contraseña en una base de datos existente
1. En el menú Ver, haga clic en Explorador de servidores.
2. En la ventana Explorador de servidores, haga clic con el botón secundario del mouse en el origen de datos cuya
contraseña desea cambiar.
3. En el menú contextual, haga clic en Propiedades de la base de datos.
4. En el cuadro de diálogo Propiedades de la base de datos, haga clic en Establecer contraseña.
5. Escriba las contraseñas anterior y nueva y, a continuación, haga clic en Aceptar.
Vea también
Tareas
Cómo: Crear una base de datos (Dispositivos)
Otros recursos
Securing Databases (SQL Server Mobile)
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Instalar bases de datos de ejemplo
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Vea también
Otros recursos
New Table
Edit Table (SQL Server Mobile)
Table Properties
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Generar código SqlCeResultSet (Dispositivos)
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
this.customersBindingSource.EndEdit();
this.customersTableAdapter.Update(this.northwindDataSet.
Customers);
Vea también
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Nota
Hay que distingue entre esta cadena y la cadena de conexión en tiempo de ejecución. Para obtener más información, consult
e Propiedad Cadena de conexión, cuadro de diálogo Propiedades de archivo (Dispositivos).
Vea también
Tareas
Cómo: Editar una cadena de conexión
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
4. Expanda el ensamblado que contiene el objeto que desea enlazar y, a continuación, seleccione el objeto en la vista de
árbol.
5. Haga clic en Finalizar.
El origen de datos se agrega a la ventana Orígenes de datos.
Para agregar un origen de datos a un formulario
1. En el menú Datos, haga clic en Mostrar orígenes de datos para abrir la ventana Orígenes de datos.
2. Seleccione elementos en la ventana Orígenes de datos y arrástrelos hasta un formulario Windows Forms para crear
controles enlazados a las propiedades del objeto. Para obtener más información, vea Información general sobre la
presentación de datos.
Vea también
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
11. En la página Elija los objetos de base de datos, seleccione los objetos que desee utilizar como orígenes de datos y, a
continuación, haga clic en Finalizar.
La conexión de datos aparece ahora como un origen de datos en la ventana Orígenes de datos.
Vea también
Otros recursos
Administrar orígenes de datos en proyectos de dispositivos
Desarrollo para Smart Device
Nota
Las opciones disponibles en los cuadros de diálogo y los comandos de menú difieren en función de la configuración de desa
rrollo. Para escribir el tutorial se utilizó la configuración de desarrollo de Visual Basic y la configuración de desarrollo de Visu
al C#. Para ver o cambiar su configuración, elija Importar y exportar configuraciones en el menú Herramientas, haga clic
en Restablecer configuración del IDE, seleccione la configuración que desee y, a continuación, haga clic en Restablecer c
onfiguración.
MessageBox.Show("Hello, World!")
— o bien —
Inserte el código siguiente de C#:
MessageBox.Show("Hello, World!");
Vea también
Otros recursos
Programar para dispositivos con Visual C++
Desarrollo para Smart Device
Asignar arquitecturas
eMbedded Visual C++ admitía algunas arquitecturas de dispositivos que Visual Studio 2005 ya no admite. Esto se debe a que
las nuevas plataformas de hardware para las que es posible desarrollar aplicaciones en Visual Studio 2005 exigen el uso de
arquitecturas más recientes. Afortunadamente, se puede establecer una correspondencia (asignación) entre todas las
arquitecturas anteriores y las arquitecturas de dispositivo más modernas. El asistente para actualizaciones lleva a cabo esta
asignación automática. La tabla muestra las arquitecturas de dispositivo admitidas por eMbedded Visual C++ frente a las
arquitecturas de dispositivo admitidas por Visual Studio 2005.
Arquitectura de eVC Arquitectura compatible de Visual Studio 2005
ARM ARMv4
ARMv4 ARMv4
ARMv4i ARMv4i
ARMv4T ARMv4i
MIPS MIPSII
Mips16 MIPSII
MipsII MipsII
MipsII_fp MipsII_fp
MipsIV MipsIV
MipsIV_fp MipsIV_fp
SH3 SH4
SH4 SH4
Emulador X86
X86 X86
Cuando se actualiza el proyecto de eVC utilizando el asistente, el nuevo proyecto creado en Visual Studio 2005 tiene como
destino cualquiera de los SDK instalados que admiten la arquitectura en el nuevo proyecto. Las arquitecturas migradas
heredan sus valores de configuración de una de las arquitecturas de eVC. La siguiente tabla ilustra la asignación de
arquitecturas de dispositivos admitidas de eMbedded Visual C++ frente a arquitecturas de dispositivos admitidas de Visual
Studio 2005.
Arquitectura original Se corresponde con Notas
Distinta de ARM/ARMV Vea la tabla de la sección "Asignar
4/ARMV4I arquitecturas"
ARM, pero no ARMV4i ARMV4 y ARMV4i Los valores de configuración de ARMV4i se heredan de la configu
ración de ARM en eVC.
ARMV4, pero no ARMV ARMV4 y ARMV4i Los valores de configuración de ARMV4i se heredan de la configu
4i ración de ARMV4 en eVC.
ARM/ARMV4 y ARMV4i ARMV4 y ARMV4i Los valores de configuración de ARMV4i se heredan de la configu
ración de ARMV4i en eVC.
eMbedded Visual C++ versión 4.0 establece, de forma predeterminada, el estilo de cuadro de diálogo en DS_MODALFRAME para
aplicaciones de Pocket PC MFC. En MFC 8.0 no se admite este estilo.
Nota
Si aparece el mensaje de error "No hay plataformas que coincidan con las plataformas originales de este archivo de proyecto
", quizás sea necesario instalar una versión compatible del SDK con el que se configuró el proyecto original.
Vea también
Referencia
Windows Mobile Platform Migration FAQ for Developers
Migrating Microsoft eMbedded Visual C++ Projects to Visual Studio 2005
Step by Step: Migrating an eMbedded Visual C++ Application to Visual Studio 2005
Conceptos
Problemas conocidos con el traslado desde eVC
Desarrollo para Smart Device
Algunas clases de colección, como CObArray, CMapPtrToPtr, etc., se implementan en CE 5. Para evitar esta diferencia en la im
0 mediante versiones con plantilla de CArray<>, CMap<>, etc. En las bibliotecas de eMbe plementación, cambie la macro IM
dded Visual C++ y C++ para escritorio, estos tipos se implementan como clases normales PLEMENT_SERIAL para que utilice
sin plantilla. Por tanto, al llamar a IMPLEMENT_SERIAL en estas clases con plantilla se prod CObject en lugar de CObArray, CM
uce un error de compilación: apPtrToPtr, etc.
error C2039: 'classCObArray': no es un miembro de 'CArray <TYPE, ARG_TYPE>' Es decir, no escriba esto:
error C2065: 'classCObArray': identificador no declarado IMPLEMENT_SERIAL(CYourClass, C
ObArray, 0)
Utilice en su lugar:
IMPLEMENT_SERIAL(CYourClass, C
Object, 0)
De forma predeterminada, eMbedded Visual C++ versión 4.0 establece el estilo de los cuadros de diálogo en
DS_MODALFRAME para las aplicaciones de Pocket PC MFC. En MFC 8.0, este estilo no se admite.
Ejemplos
En esta sección se describen algunos de los errores más comunes que puede encontrar el usuario al migrar un proyecto de
eMbedded Visual C++ a Visual Studio 2005. Para obtener más información, consulte Migrating Microsoft eMbedded Visual
C++ Projects to Visual Studio 2005.
Error de compilación: No se puede abrir el archivo de inclusión 'wceres.rc'
Haga clic con el botón secundario del mouse en el archivo de recursos del proyecto (RC), seleccione Ver código y, a
continuación, marque como comentario la línea siguiente:
//#include "wceres.rc"
Código modificado:
Vea también
Conceptos
Asistente para actualización de eMbedded Visual C++ a Visual Studio 2005
Otros recursos
Windows Mobile Platform Migration FAQ for Developers
Desarrollo para Smart Device
Proyecto Win32 de Smart Device – Aplica Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
ción de consola o en el momento de la creación del proyecto.
Proyecto Win32 de Smart Device – Archi Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
vo DLL o en el momento de la creación del proyecto.
Proyecto Win32 de Smart Device – Biblio Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
teca estática o en el momento de la creación del proyecto.
Proyecto ATL de Smart Device – Archivo Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
DLL o en el momento de la creación del proyecto.
Proyecto ATL de Smart Device – Archivo Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
EXE o en el momento de la creación del proyecto.
Aplicación de Smart Device MFC – SDI Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
o en el momento de la creación del proyecto.
Aplicación de Smart Device MFC – SDI co Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
n DocList o en el momento de la creación del proyecto.
Aplicación de Smart Device MFC – Basad Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
a en cuadros de diálogo o en el momento de la creación del proyecto.
DLL para Smart Device MFC – Archivo DL Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
L estándar o en el momento de la creación del proyecto.
Control ActiveX para Smart Device MFC Vínculo estático. No se proporciona ninguna opción para vínculo dinámico o estátic
o en el momento de la creación del proyecto.
DLL para Smart Device MFC – Archivo DL Vínculo dinámico. No se proporciona ninguna opción para vínculo dinámico o estát
L de extensión ico en el momento de la creación del proyecto.
La tabla anterior hace referencia a la implementación utilizando la tecla de método abreviado F5. La instalación de la aplicación
tiene lugar como se describe en esta sección:
A la hora de crear un proyecto CAB de Smart Device para una aplicación diseñada en C++, es necesario agregar de
forma manual cualquier dependencia, como atl80.dll, mfc80U.dll y/o msvcrt.dll, al proyecto CAB en cuestión si se
están estableciendo vínculos de forma dinámica a los archivos DLL especificados. Si se están estableciendo vínculos de
forma dinámica y resulta necesario redistribuir los archivos DLL del proyecto CAB, no instale los archivos DLL en el
directorio del sistema (como \windows) en el dispositivo. En su lugar, instale los archivos DLL en el directorio local de la
aplicación. Si se está redistribuyendo un conjunto de aplicaciones y todas están vinculadas de forma dinámica a los
tiempos de ejecución de ATL/MFC, se recomienda instalar todas las aplicaciones, junto con los archivos DLL en tiempo de
ejecución, en un solo directorio de aplicaciones y proporcionar accesos directos a las aplicaciones en cuestión que se
pueden colocar en sus propias carpetas. De este modo se ahorrará espacio y se evitará el riesgo de que los archivos DLL
del directorio del sistema se reemplacen posteriormente al realizar otra instalación de una aplicación y se interrumpan
las aplicaciones que estén vinculadas de forma dinámica a los archivos DLL.
Se recomienda el establecimiento de vínculos estáticos para reducir las dependencias en los archivos DLL de MFC/ATL. Si
se están estableciendo vínculos de forma estática, los archivos DLL no se deberían redistribuir con la aplicación en
cuestión.
Vea también
Otros recursos
Desarrollar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
Interfaz Los proyectos de dispositivos no admiten la casilla de verificación Compatible con automatización.
Compatibi Los proyectos de dispositivos no admiten la casilla de verificación IObjectWithSite (compatibilidad con objet
lidad os de IE).
Vea también
Otros recursos
Asistentes para clases en proyectos de dispositivos de C++
Desarrollo para Smart Device
Vea también
Otros recursos
Asistentes para clases en proyectos de dispositivos de C++
Desarrollo para Smart Device
Vea también
Otros recursos
Asistentes para clases en proyectos de dispositivos de C++
Desarrollo para Smart Device
Vea también
Otros recursos
Opciones del asistente en los proyectos de dispositivos nativos
Desarrollo para Smart Device
Interfaz Los proyectos de dispositivos no admiten la casilla de verificación Compatible con automatización.
Compatibi Los proyectos de dispositivos no admiten la casilla de verificación IObjectWithSite (compatibilidad con objetos d
lidad e IE).
Vea también
Otros recursos
Asistentes para clases en proyectos de dispositivos de C++
Desarrollo para Smart Device
Vea también
Otros recursos
Asistentes para clases en proyectos de dispositivos de C++
Desarrollo para Smart Device
El Asistente para proyectos ATL de Smart Device no implementa la eliminación del Registro de la
biblioteca de tipos
Dado que Windows Mobile no implementa la funcionalidad de COM para quitar bibliotecas de tipos del Registro, el Asistente
para proyectos ATL de Smart Device genera código que implementa la función DllUnregisterServer de forma diferente:
La acción de pasar false a la función DllUnregisterServer indica a COM que no debe eliminar del Registro la biblioteca de
tipos. Si se cambia el parámetro a true, se producirá un error en todas las llamadas a DllUnregisterServer con E_NOTIMPL.
Vea también
Otros recursos
Opciones del asistente en los proyectos de dispositivos nativos
Desarrollo para Smart Device
Si se cambia Uso de MFC de Utilizar MFC en un archivo DLL compartido (predeterminado) a Utilizar MFC
en una biblioteca estática, también debería quitarse mfc80ud.dll (Depurar) y/o mfc80u.dll (Publicar) de Ar
chivos adicionales en la sección General de la página de propiedades de implementación.
Del mismo modo, si se cambia Uso de MFC de Utilizar MFC en una biblioteca estática a Utilizar MFC en u
n archivo DLL compartido, también se debería agregar mfc80ud.dll (Depurar) y mfc80u.dll (Publicar) a Arc
hivos adicionales en la sección General de la página de propiedades Implementación.
Cuando agregue mfc80u.dll o mfc80ud.dll, también debe agregar atl80.dll y msvcr80.dll o msvcr80d.dll.
Vea también
Referencia
Páginas de propiedades (C++)
Otros recursos
Opciones del asistente en los proyectos de dispositivos nativos
Desarrollo para Smart Device
BEGIN
IDR_MENU,
2,
I_IMAGENONE, IDM_OK, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_AUTOSIZE,
IDS_OK, 0, NOMENU,
I_IMAGENONE, IDM_HELP, TBSTATE_ENABLED, TBSTYLE_DROPDOWN | TBSTYLE_AUTOSIZE,
IDS_HELP, 0, 0,
END
Cuando trabaje con editores de recursos para dispositivos, puede obtener errores por las razones siguientes:
Porque ha editado un elemento RESX que pertenece a otro elemento de proyecto, como un formulario o un control de
usuario.
Porque el Diseñador de Windows Forms desecha automáticamente los elementos que no tienen un vínculo con un
control. También quita todos los comentarios, no admite elementos vinculados y no carga el formulario o el control de
usuario si se ha agregado uno al archivo RESX en el editor de recursos.
Porque algunos tipos de recursos, como los archivos Tiff, no se admiten en Windows CE.
Porque también se genera un error cuando el formato del archivo de recursos no es compatible, el archivo está vacío o el
formato está dañado.
Vea también
Otros recursos
Editores de recursos para proyectos de dispositivos
Desarrollo para Smart Device
#ifdef SMARTPHONE2003_UI_MODEL
#include "ResourceFileName.h"
#endif
3.
Vea también
Otros recursos
Editores de recursos para proyectos de dispositivos
Desarrollo para Smart Device
Para ver una lista actualizada de los controles de cuadro de diálogo que admiten los dispositivos, cree un proyecto de
dispositivo nativo de Win32 .exe, haga doble clic en el archivo RC file y, a continuación, expanda el nodo Diálogo para abrirlo.
Controles únicos de los dispositivos
El editor de cuadros de diálogo Visual Studio 2005 también agrega dos nuevos controles para el desarrollo de dispositivos.
Control Descripción
Control CAPEdit El control CAPEdit es un control de edición que pone en mayúscula la primera letra de cada pal
abra en el control.
Estado del panel de entrada ( El control State of Input Panel (Estado del panel de entrada) abre el panel de entrada en plataf
Control) ormas que lo admiten.
Vea también
Otros recursos
Controles del cuadro de diálogo Dispositivo
Desarrollo para Smart Device
Control CAPEdit
El control CAPEdit se comporta como un control CEdit Class en todo menos en que la primera letra del mismo se pone en
mayúscula automáticamente. Este control simplifica el proceso de entrada de cadenas de caracteres largas y se utiliza a
menudo en situaciones en las que los usuarios necesitan especificar información que siempre debe escribirse en mayúsculas,
como los nombres y las ubicaciones.
Vea también
Referencia
CDialog Class
Otros recursos
Controles de cuadro de diálogo únicos en los dispositivos
Crear un control de edición
Desarrollo para Smart Device
Vea también
Conceptos
Controles de cuadro de diálogo admitidos en los dispositivos
Otros recursos
Controles de cuadro de diálogo únicos en los dispositivos
Desarrollo para Smart Device
Ficha Avanzadas, lista d Proyectos de dispositivos en Propiedades del proyecto, ficha Avanzadas, lista desplegable ARM T
esplegable ARM Thumb humb y ARM Interwork en el nodo C/C++, en el cuadro desplegable aparecen las siguientes opcio
y ARM Interwork. nes: Sí (/QRInterwork-return) y la opción No. Cuando se establece a sí, el compilador genera códig
o thunk para el código ARM interwork de 16 y 32 bits.
Ficha Avanzadas, lista d Proyectos de dispositivos en Propiedades del proyecto, ficha Avanzadas, lista desplegable Habili
esplegable Habilitar em tar emulación de punto flotante en el nodo C/C++, en el cuadro desplegable aparecen las siguie
ulación de punto flota ntes opciones: Sí y No. Cuando se establece en Sí, el compilador habilita operaciones de emulación
nte. de punto flotante.
Ficha Preprocesador, cu Proyectos de dispositivos en Propiedades del proyecto, ficha Preprocesador, cuadro de texto de e
adro de texto de entrada ntrada Definiciones del preprocesador, en el nodo C/C++, hay una casilla de verificación para He
Definiciones del prepr redar de primario o valores pred. del proyecto y un botón Macros para agregar macros.
ocesador.
Ficha Optimización, list Proyectos de dispositivos en Propiedades del proyecto, ficha Optimización, lista desplegable Def
a desplegable Definicio iniciones de coherencia de punto flotante, en el nodo C/C++, aparece una lista desplegable para
nes de coherencia de seleccionar Coherencia predeterminada o Mejorar coherencia (/Op).
punto flotante.
Para obtener más información, vea Opciones del compilador, por orden alfabético.
Cambios del compilador entre Visual Studio 2003 y Visual Studio 2005
Debido a que los compiladores de dispositivos se basan en el compilador de Visual C++ para equipos de escritorio, examinar
las diferencias entre versiones de compiladores de escritorio proporciona una buena imagen de los cambios existentes entre
los compiladores de dispositivos de eMbedded Visual C++ y los compiladores de dispositivos de Visual Studio 2005. Para
obtener información sobre los cambios entre Visual Studio 6.0 y Visual Studio 2003, vea Standard Compliance Issues in Visual
C++.
En la tabla siguiente se resumen los cambios de compilador entre Visual Studio 2003 y Visual Studio 2005.
Problema Descripción
Los punteros a mi El código que se escribió para versiones anteriores del compilador que sólo utilizaba el nombre del método
embros requieren generará ahora el Error del compilador C3867 o la Advertencia del compilador C4867. La norma ISO C++ r
ahora el nombre c equiere este diagnóstico. Para crear un puntero a una función miembro, se deben utilizar el operador de dir
ompleto, el opera ección (&) y el nombre completo del método. Pueden producirse errores si no se requieren el operador &
dor de dirección ( y el nombre completo del método, o si se omiten paréntesis en las llamadas a funciones. El uso del nombre
&) y paréntesis en de la función sin una lista de argumentos produce un puntero a función que se puede convertir a varios tip
las llamadas a fun os. Por consiguiente, el código puede dar lugar a un comportamiento inesperado en tiempo de ejecución.
ciones.
Una clase debe ser Los compiladores anteriores de Visual C++ habilitaban una declaración friend a una clase que no era acces
accesible a una de ible en el ámbito de la clase que contenía la declaración. En Visual C++ 2005, estas circunstancias harán qu
claración friend. e el compilador genere el Error del compilador C2248. Para solucionarlo, se debe cambiar la accesibilidad d
e la clase que se especifica en la declaración friend. Este cambio se ha realizado para cumplir los requisitos
de la norma ISO C++.
No se permite la e El código que depende de una especialización explícita de plantilla para un constructor de copias o un oper
specialización expl ador de asignación de copia generará ahora el Error del compilador C2299. La norma ISO C++ prohíbe est
ícita como constru e uso. Este cambio se ha realizado por razones de compatibilidad y para mejorar la portabilidad del código.
ctor de copias ni c
omo operador de
asignación de copi
a.
Una plantilla de cl El uso del nombre de una clase de plantilla no especializada en la lista de clases base para una definición de
ase no especializa clase producirá el Error del compilador C3203. No se puede utilizar el nombre de una clase de plantilla no
da no se puede uti especializada como parámetro de plantilla en una lista de clases base. Se deben agregar explícitamente los
lizar como argum parámetros de tipo de plantilla al nombre de clase de plantilla cuando se utilice como parámetro de plantill
ento de plantilla e a en una lista de clases base. Este cambio se ha realizado por razones de compatibilidad y para mejorar la p
n una lista de clas ortabilidad del código.
es base.
Ya no se permite u El código que tiene una declaración using a un tipo anidado generará ahora el Error del compilador C2885.
na declaración usi Para solucionarlo, es necesario utilizar referencias completas a tipos anidados, colocar el tipo en un espacio
ng de tipo anidad de nombres o crear un objeto typedef. Este cambio se ha realizado por razones de compatibilidad y para
o. mejorar la portabilidad del código.
Se quita la opción La opción del compilador /YX generaba compatibilidad automática de los encabezados precompilados. Se
del compilador /Y utilizaba de manera predeterminada desde el entorno de desarrollo. Si se quita la opción del compilador /Y
X. X de las configuraciones de generación, puede que las generaciones sean más rápidas. Además de los prob
lemas de rendimiento, la opción del compilador /YX introduce la posibilidad de un comportamiento inespe
rado en tiempo de ejecución. Es preferible utilizar /Yc, Crear archivo de encabezado precompilado, y /
Yu, Utilizar archivo de encabezado precompilado, ya que proporciona un mayor control sobre la form
a de utilizar los encabezados precompilados.
Se quitan las opci Se han quitado las opciones del compilador /Oa y /Ow, y se omitirán. Utilice los modificadores noalias, re
ones del compilad strict o declspec para especificar cómo realiza el compilador el efecto escalonado (aliasing).
or /Oa y /Ow.
Se quita la opción Se ha quitado la opción del compilador /Op. Se puede utilizar /fp:precise en su lugar.
del compilador /O
p.
Se han quitado las Visual C++ 2005 ya no proporciona compatibilidad con la biblioteca CRT vinculada estáticamente de un ún
opciones del com ico subproceso. Se puede utilizar /MT y /MTd en su lugar.
pilador /ML y /ML
d.
Se han quitado las El compilador utiliza ahora un modelo mixto que intenta crear el mejor archivo de resultados para todas las
opciones del com arquitecturas.
pilador /G3, /G4, /
G5, /G6, /G7 y /G
B.
Se ha quitado la o Puede utilizar /GF en su lugar. /GF coloca las cadenas agrupadas en una sección de sólo lectura, que es má
pción del compila s segura que la sección de escritura donde las agrega /Gf.
dor /Gf.
Ahora, la opción p La comprobación del desbordamiento del búfer está activada de manera predeterminada. Puede desactivar
redeterminada del la comprobación de la saturación del búfer con /GS-.
compilador es /GS
.
La variable /Zc:wc Este es el comportamiento conforme a la norma ISO C++: El valor predeterminado de una variable wchar_t
har_t está ahora a será el tipo integrado en lugar de un entero corto sin signo. Este cambio interrumpirá la compatibilidad bin
ctivada de manera aria cuando el código de cliente se vincule a bibliotecas que se compilaron sin /Zc:wchar_t. Se puede utiliz
predeterminada. ar /Zc:wchar_t- para revertir al comportamiento anterior no conforme a la norma. Este cambio se ha intro
ducido para crear código compatible de manera predeterminada.
La variable /Zc:fo Este es el comportamiento conforme a la norma ISO C++: El código que depende del uso de una variable d
rScope está ahora eclarada en un bucle for después de la finalización del ámbito del bucle for ya no se compilará. Se puede u
activada de maner tilizar /Zc:forScope para revertir al comportamiento anterior no conforme a la norma. Este cambio se ha i
a predeterminada. ntroducido para crear código compatible de manera predeterminada.
Forzar la comprob El código que pasa atributos con nombre al constructor de atributos entre comillas cuando el tipo no es un
ación de parámetr a cadena, y sin comillas cuando el tipo es una cadena, generará ahora el Error del compilador C2065 o la A
os para los atribut dvertencia del compilador (nivel 1) C4581. Anteriormente, todos los atributos del compilador se analizaban
os de Visual C++. como cadenas y, si era necesario, el compilador insertaba las comillas inexistentes. La compatibilidad con at
ributos se ha mejorado al agregar la validación de comprobación de parámetros. Este cambio evitará que s
e produzca un comportamiento inesperado por pasar argumentos incorrectos a un constructor de atributo
s.
El compilador no i El código que omite el tipo en una declaración ya no tiene como tipo predeterminado int. El compilador ge
nsertará el tipo int nerará la Advertencia del compilador C4430 o la Advertencia del compilador (nivel 4) C4431. La norma ISO
como tipo predete C++ no admite un tipo int predeterminado y este cambio ayudará a garantizar que se obtiene el tipo espec
rminado en declar ificado explícitamente.
aciones.
Para obtener más información, vea Breaking Changes in the Visual C++ 2005 Compiler.
Vea también
Otros recursos
Desarrollar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
#ifndef WIN32_PLATFORM_WFSP
HACCEL hAccelTable;
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WIN32SMARTDEVICE);
#endif // !WIN32_PLATFORM_WFSP
Bucles de mensajes. Para obtener más información, vea Message Handling and Command Targets.
// FUNCTION: MyRegisterClass()
ATOM MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass)
{
WNDCLASS wc;
return RegisterClass(&wc);
}
InitInstance: FUNCTION InitInstance(HANDLE, int) Para obtener más información, vea InitInstance Member Function.
WIN32_PLATFORM_WFSP se utiliza como una condición para Smartphone y WIN32_PLATFORM_PSPC para Pocket PC. Siempre
es posible definir los propios condicionales si se desea establecer grandes diferencias.
g_hInst = hInstance;
// Store instance handle in your global variable.
#ifdef WIN32_PLATFORM_PSPC
// SHInitExtraControls should be called once during your application's initializat
ion to initialize any
// of the Pocket PC special controls such as CAPEDIT and SIPPREF.
SHInitExtraControls();
#endif // WIN32_PLATFORM_PSPC
if (!MyRegisterClass(hInstance, szWindowClass))
{
return FALSE;
}
if (!hWnd)
{
return FALSE;
}
#ifdef WIN32_PLATFORM_PSPC
// When the main window is created using CW_USEDEFAULT,
// the height of the menubar is not taken into account.
// So the generated code resizes the window after creating it.
if (g_hWndMenuBar)
{
RECT rc;
RECT rcMenuBar;
GetWindowRect(hWnd, &rc);
GetWindowRect(g_hWndMenuBar, &rcMenuBar);
rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top);
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
También se genera un cuadro de diálogo Acerca de para una determinada aplicación como un ejemplo sobre cómo
generar otros cuadros de diálogo que se podría desear: LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM
wParam, LPARAM lParam).
// Global Variables:
HINSTANCE g_hInst;
// Current instance:
HWND g_hWndMenuBar;
// Menu bar handle
Algunos de los principales mensajes, como WM_COMMAND, ya están incluidos para su uso y para su extensibilidad. Se
incluye WinProc para mensajes de entrada del usuario y del sistema de procesamiento: LRESULT CALLBACK WndProc(HWND
hWnd, UINT message, WPARAM wParam, LPARAM lParam. Para obtener más información sobre WinProc, vea Información
general sobre Windows.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
HGDIOBJ hbrWhite, hbrGray;
POINT aptStar[6] = {50,2, 2,98, 98,33, 2,33, 98,98, 50,2};
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hWnd;
mbi.nToolBarId = IDR_MENU;
mbi.hInstRes = g_hInst;
if (!SHCreateMenuBar(&mbi))
{
g_hWndMenuBar = NULL;
}
else
{
g_hWndMenuBar = mbi.hwndMB;
}
#ifndef WIN32_PLATFORM_WFSP
// Initialize the shell activate info structure
memset(&s_sai, 0, sizeof (s_sai));
s_sai.cbSize = sizeof (s_sai);
#endif // !WIN32_PLATFORM_WFSP
#endif // SHELL_AYGSHELL
hbrWhite = GetStockObject(WHITE_BRUSH);
hbrGray = GetStockObject(GRAY_BRUSH);
return 0L;
break;
case WM_PAINT:
RECT rc;
hdc = BeginPaint(hWnd, &ps);
GetClientRect(hWnd, &rc);
Polyline(hdc, aptStar, 6);
EndPaint(hWnd, &ps);
return 0L;
break;
case WM_DESTROY:
#ifdef SHELL_AYGSHELL
CommandBar_Destroy(g_hWndMenuBar);
#endif // SHELL_AYGSHELL
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
#ifndef WIN32_PLATFORM_WFSP
// Message handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG:
#ifdef SHELL_AYGSHELL
{
// Create a Done button and size it.
SHINITDLGINFO shidi;
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN | SHIDIF_SIZEDLGFUL
LSCREEN | SHIDIF_EMPTYMENU;
shidi.hDlg = hDlg;
SHInitDialog(&shidi);
}
#endif // SHELL_AYGSHELL
return TRUE;
case WM_COMMAND:
#ifdef SHELL_AYGSHELL
if (LOWORD(wParam) == IDOK)
#endif
{
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
break;
case WM_CLOSE:
EndDialog(hDlg, message);
return TRUE;
#ifdef _DEVICE_RESOLUTION_AWARE
case WM_SIZE:
{
DRA::RelayoutDialog(
g_hInst,
hDlg,
DRA::GetDisplayMode() != DRA::Portrait ? MAKEINTRESOURCE(IDD_ABOUTBO
X_WIDE) : MAKEINTRESOURCE(IDD_ABOUTBOX));
}
break;
#endif
}
return FALSE;
}
#endif // !WIN32_PLATFORM_WFSP
Vea también
Tareas
Tutorial: Crear un formulario Windows Forms sencillo
Referencia
General, Herramientas de dispositivo, Opciones (Cuadro de diálogo)
Cuadro de herramientas
Otros recursos
Tutoriales sobre dispositivos inteligentes
Desarrollar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
CSIDL_FAVO 0x0 Directorio del sistema de archivos que actúa como repositorio común de los elementos favoritos del usuari
RITES 006 o.
CSIDL_PERSO 0x0 Directorio del sistema de archivos que actúa como repositorio común de documentos.
NAL 005
CSIDL_PROG 0x0 Directorio del sistema de archivos que contiene los grupos de programas del usuario, que también son los
RAMS 002 directorios del sistema de archivos.
CSIDL_START 0x0 Directorio del sistema de archivos que corresponde al grupo de programas de inicio del usuario. El sistema
UP 007 inicia estos programas cuando se conecta la alimentación de un dispositivo.
Para especificar la ruta de acceso remota para el resultado principal del proyecto
1. En el Explorador de soluciones, haga clic con el botón secundario del mouse en <Nombre de proyecto> y, a
continuación, haga clic en Propiedades en el menú contextual.
2. Expanda el nodo Propiedades de configuración y haga clic en Implementación.
3. En el panel situado más a la derecha, establezca la propiedad Directorio remoto del proyecto.
Vea también
Otros recursos
Desarrollar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
Como el entorno de desarrollo puede utilizarse en varias plataformas, al alojar objetos ActiveX ATL o MFC en un
proyecto de dispositivo y en un recurso de cuadro de diálogo, deberá crear y registrar un control en un proyecto Active X
de escritorio equivalente para que se pueda agregar a la plantilla de cuadro de diálogo de dispositivo en el editor de
recursos y ejecutarse correctamente. El escritorio y las versiones de dispositivo del control ActiveX debería tener el
mismo GUID y las mismas propiedades en tiempo de diseño, como el color de fondo.
En esta sección
Configuración de depuración e implementación de los proyectos de dispositivos de Visual C++
Explica las propiedades de depuración e implementación únicas de los proyectos de dispositivo de Visual C++.
Vea también
Referencia
Depurar, Propiedades de configuración, Páginas de propiedades de <nombreDeProyecto> (Cuadro de diálogo, Dispositivos)
Conceptos
Configuración de depuración e implementación de los proyectos de dispositivos de Visual C++
Otros recursos
Depurar proyectos de dispositivos
Crear y trasladar proyectos de dispositivos de Visual C++
Desarrollar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
Nota
Al desarrollar un proyecto de dispositivo nativo, puede que los proyectos dependientes no se desarrollen automáticam
ente con el proyecto de dispositivo nativo y que requieran una implementación independiente.
Vea también
Otros recursos
Generar y depurar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
En esta sección
Diferencias entre depuradores de dispositivos y de escritorio
Describe áreas donde la experiencia de la depuración en dispositivos difiere de la depuración de escritorio.
Cómo: Conectar a procesos de dispositivos administrados
Describe cómo agregar procesos administrados que ya se están ejecutando.
Cómo: Cambiar la configuración del Registro en un dispositivo
Describe la utilización del Editor de Registro remoto para cambiar la configuración del Registro en el dispositivo.
Tutorial: Depurar una solución que incluye código administrado y código nativo
Describe los pasos para iniciar como alternativa los depuradores nativos y administrados.
Vea también
Otros recursos
Desarrollo de dispositivos inteligentes
Depurar y generar perfiles de aplicaciones
Mobile Developer Center
Desarrollo para Smart Device
Problemas de conexión
La desconexión del dispositivo mientras se está ejecutando el depurador causa el cierre de éste por error de conexión. El error
de conexión ocurre porque la aplicación sigue ejecutándose en segundo plano en el dispositivo. El botón X del Pocket PC es un
dispositivo inteligente que minimiza la característica y no cierra la aplicación. En su lugar, establece la aplicación para ejecutar
en segundo plano.
Para cerrar correctamente una aplicación para que se está ejecutando en segundo plano en Pocket PC, en el menú Inicio,
seleccione Configuración, seleccione la ficha Sistema y, a continuación, seleccione Memoria. En la ficha Programas
ejecutándose, seleccione la aplicación que desea cerrar y, además, seleccione Detener.
Vea también
Otros recursos
Guía básica del depurador
Depurar proyectos de dispositivos
Desarrollo para Smart Device
Aparece un mensaje de error si se intenta agregar dos depuradores o si se intenta para tales efectos utilizar un depurador
administrado cuando no se ha establecido la clave de Registro de dispositivos.
Es posible iniciar un proceso de varias formas, incluyendo el Explorador de archivos, la línea de comandos, etcétera. En el
siguiente paso, hay que iniciar el proceso partiendo del menú Depurar. También es posible iniciar un proceso sin el depurador
administrado y, a continuación, agregarlo.
Si se establece como destino una plataforma de Windows CE generada a partir del generador de plataformas, es necesario
contar con la biblioteca toolhelp.dll para rellenar el panel Procesos disponibles. Esta biblioteca se incluye en los SDK de
Windows Mobile.
Nota
Los cuadros de diálogo y comandos de menú que se ven pueden diferir de los descritos en la Ayuda, en función de los valore
s de configuración o de edición activos. Para cambiar la configuración, elija la opción Importar y exportar configuraciones
del menú Herramientas. Para obtener más información, vea Valores de configuración de Visual Studio.
5. En el cuadro de diálogo Conectar con dispositivo, seleccione la plataforma, el dispositivo y, a continuación, haga clic en
Conectar.
6. En el panel Procesos disponibles, seleccione uno o más procesos a los que desee asociarse y, a continuación, haga clic
en Asociar.
Nota
De manera predeterminada, el tipo de código se establece automáticamente en Administrado (.NET Compact Frame
work) si se encuentra disponible, de lo contrario se establece en Nativo (Smart Device). Para reemplazar los valores
de configuración predeterminados, haga clic en Seleccionar para abrir el cuadro de diálogo Seleccionar tipo de cód
igo. Obsérvese que no se pueden seleccionar ambas opciones.
Nota
No se admite la depuración de interoperabilidad. Es decir, no se puede realizar una depuración de los tipos de código a
dministrado y nativo al mismo tiempo.
Vea también
Otros recursos
Depurar proyectos de dispositivos
Desarrollo para Smart Device
Este tutorial ha sido escrito utilizando la configuración de desarrollo de Visual C#. Contiene las siguientes secciones:
Habilitar la asociación del depurador administrado
Iniciar la aplicación
Establecer un punto de interrupción en el código nativo
Asociar con el depurador nativo
Ejecutar el punto de interrupción nativo
Asociar con el depurador administrado
Establecer un punto de interrupción en el código administrado
Ejecutar hasta el punto de interrupción administrado
Conclusión
Requisitos previos
Este tutorial se basa en una solución generada con otro tutorial, Tutorial: Hola a todos: Ejemplo de interoperabilidad COM para
Smart Devices. Asegúrese de que el tutorial Hola a todos se ha generado y ejecutado correctamente.
Habilitar la asociación del depurador administrado
De forma predeterminada, los dispositivos (incluidos los emuladores) no permiten al depurador administrado asociarse a
procesos que ya se están ejecutando. La asociación del depurador administrado a un proceso que ya está en ejecución es una
situación que suele darse en las soluciones de dispositivos que incluyen tanto código administrado como código nativo.
Por tanto, el primer paso es configurar el dispositivo para permitir que el depurador administrado se asocie a un proceso que
ya se está ejecutando. Esto se hace estableciendo una clave del Registro en el dispositivo.
Nota
El establecimiento de la clave afecta sólo a la asociación de procesos administrados que ya estén en ejecución. No afecta al la
nzamiento de un proyecto utilizando Iniciar con depuración (F5). No obstante, si se desasocia después de Iniciar con dep
uración, necesitará este proceso para volver a asociar e iniciar de nuevo la depuración.
7. Deje abierto el emulador del dispositivo para conservar la configuración del Registro en los pasos siguientes. Puede
cerrar el Editor del Registro.
Iniciar la aplicación
El paso siguiente es iniciar la aplicación de InteropSolution.
Para iniciar la aplicación
1. Abra la solución que creó en Tutorial: Hola a todos: Ejemplo de interoperabilidad COM para Smart Devices.
Asegúrese de que el Pocket PC 2003 SE - Emulador aparece en el cuadro Dispositivo de destino en la barra de
herramientas.
2. En el menú Depurar de Visual Studio, haga clic en Iniciar depuración o presione F5.
Este paso implementa inmediatamente el proyecto nativo, HelloCOMObject, en el emulador sin que se necesaria ninguna
otra intervención del usuario.
3. Cuando se abra el cuadro de diálogo Implementar SayHello, seleccione Pocket PC 2003 SE - Emulador y haga clic en
Implementar.
Este paso implementa el proyecto administrado.
La aplicación se abre en el emulador. No haga clic todavía en el botón.
Establecer un punto de interrupción en el código nativo
El paso siguiente es establecer un punto de interrupción en el código nativo para preparar la asociación del depurador nativo.
Establecer un punto de interrupción en el código nativo
1. En el Explorador de soluciones, haga clic con el botón secundario en Hello.cpp y, a continuación, en el menú
contextual, haga clic en Ver código.
2. Inserte un punto de interrupción en la línea que comienza por *text haciendo clic en el margen izquierdo del Editor de
código.
El símbolo de punto de interrupción aparecerá como un círculo vacío con un signo de exclamación, indicando que el
punto de interrupción no se puede resolver en estos momentos. Esto se debe a que le faltan los símbolos y orígenes
adecuados en este momento.
3. En el menú Depurar de Visual Studio, seleccione Windows y, a continuación, haga clic en Módulos.
En la ventana Módulos, se mostrarán todos los módulos que se han cargado hasta ese momento, por ejemplo, la
aplicación administrada SayHello.exe. Observe que aún no se ha cargado el archivo HelloCOMObject.dll nativo porque
todavía no ha hecho clic en el botón de la aplicación.
Asociar con el depurador nativo
El paso siguiente es desasociar el depurador administrado para poder asociar el depurador nativo. Recuerde que en los
proyectos de dispositivo no es posible asociar ambos depuradores al mismo tiempo. Éstos son los pasos que debe seguir cada
vez que necesite cambiar del depurador administrado al depurador nativo.
Para asociar el depurador nativo
1. En el menú Depurar de Visual Studio, haga clic en Desasociar todo.
Este paso desasocia el depurador administrado, pero permite seguir ejecutando la aplicación.
2. En el menú Depurar, haga clic en Asociar al proceso.
3. En el cuadro Transporte, seleccione Smart Device.
4. Para rellenar el cuadro Calificador, haga clic en Examinar.
5. En el cuadro de diálogo Conectar con dispositivo, seleccione Pocket PC 2003 SE - Emulador y, a continuación, haga
clic en Conectar.
6. Para rellenar el cuadro Asociar a, haga clic en Seleccionar.
7. En el cuadro de diálogo Seleccionar tipo de código, seleccione Depurar estos tipos de código, desactive la casilla de
verificación Administrado, active la casilla Nativo y, a continuación, haga clic en Aceptar.
8. En el cuadro Procesos disponibles, seleccione SayHello.exe y, a continuación, haga clic en Asociar.
Ahora está asociado al depurador nativo.
Ejecutar el punto de interrupción nativo
Ya está listo para avanzar hasta el punto de interrupción que estableció en el código nativo. Cuando vuelva a ver la ventana
Módulos, podrá comprobar que ahora los módulos nativos están presentes. No obstante, el archivo Hellocomobject.dll
todavía no está cargado porque aún no ha hecho clic en button1.
Nota
Si ha ejecutado este tutorial anteriormente, puede que ya se hayan cargado los símbolos de depuración y puede omitir esos
pasos. Si no, en la sección siguiente se describen los pasos para cargarlos.
Visual Studio 2005 hace posible, en la mayoría de los casos, la realización de todo el trabajo de empaquetado necesario
directamente en el entorno de desarrollo integrado (IDE) de Visual Studio. Es posible crear un archivo CAB, primero, agregando
un proyecto CAB para Smart Device a la solución existente, a continuación, agregando archivos, accesos directos y entradas de
Registro con la misma interfaz de usuario utilizada con proyectos de instalación de escritorio. Al generar el proyecto de
instalación, se crea el archivo CAB.
Hay algunas diferencias entre los archivos CAB files creados para una aplicación Pocket PC y aquellos otros creados para una
aplicación Smartphone. Los archivos Pocket PC basados en Windows Mobile 2003SE o versiones anteriores no admiten
archivos CAB comprimidos o archivos CAB firmados. Los archivos CAB de Smartphone deben comprimirse y tanto el archivo
EXE como el archivo DLL, y el propio archivo CAB, deben firmarse digitalmente antes de poder ser instalados en el dispositivo.
Una vez que creado el archivo CAB con Visual Studio, el siguiente paso consiste en transferirlo al dispositivo de destino
utilizando cualquiera de los medios habituales para transferir archivos: solicitudes FTP o HTTP desde el dispositivo, copia
manual desde el equipo de desarrollo de escritorio en una carpeta de un dispositivo conectado utilizando Windows Explorer,
transferencia OTA para Smartphones, etcétera.
Vea también
Tareas
Tutorial: Empaquetar una solución Smart Device para su implementación
Conceptos
Características de IDE compatibles con el empaquetado de aplicaciones para dispositivos
Otros recursos
Desarrollo de dispositivos inteligentes
Administración de la instalación de archivos en la implementación
Desarrollo para Smart Device
Editor de Haga clic con el botón secundario del Utilice este editor para especificar los archivos que se van a agregar al proyec
l sistema mouse en el nombre de proyecto CAB to CAB y las carpetas de dispositivos donde se deberían instalar.
de archiv del Explorador de soluciones, haga
os clic en Ver y, a continuación, haga clic
en Sistema de archivos.
Editor de Haga clic con el botón secundario del Utilice este editor para especificar cualquier clave de Registro especial requeri
l Registr mouse en el nombre de proyecto CAB da por su aplicación.
o del Explorador de soluciones, haga
clic en Ver y, a continuación, haga clic
en Registro.
Ventana Seleccione el proyecto CAB en el Expl Utilice esta ventana para especificar el nombre, si es que existe alguno, para e
Propieda orador de soluciones y, a continuaci l archivo DLL de instalación CE, el nombre del fabricante de la aplicación y las
des para ón, haga clic en Ventana Propiedade versiones más antiguas y más recientes de Windows CE que la aplicación en
el proyec s en el menú Ver. cuestión puede ejecutar (atendiendo a su diseño), así como otras opciones.
to CAB
Páginas Haga clic con el botón secundario del Utilice este cuadro de diálogo para especificar la configuración (por ejemplo,
de propi mouse en el nombre de proyecto CAB Debug), nombre del archivo de resultados y certificados de seguridad.
edades d del Explorador de soluciones y, a co
el proyec ntinuación, haga clic en Propiedades.
to
Nota
Dado que estos mismos editores se utilizan para los proyectos de instalación de escritorio, puede que algunas opciones se e
ncuentren deshabilitadas para proyectos CAB de Smart Devices.
En algunos casos, puede que se cree una aplicación que sólo esté diseñada para ejecutarse en unas determinadas plataformas,
como Windows Mobile 2003 SE y posteriores. En esos casos, se puede evitar que el archivo CAB se instale en las plataformas
no compatibles que se especifiquen, pero para ello es necesario editar manualmente el archivo INF y, a continuación, volver a
empaquetar el proyecto CAB utilizando herramientas de la línea de comandos. Si se vuelve a empaquetar el proyecto CAB
utilizando Visual Studio, se sobrescribirán los cambios.
Pocket PC y Smartphone
En Windows Mobile 2003 SE y versiones anteriores, la principal diferencia entre archivos CAB para Pocket PC y archivos para
Smartphones radica en que Pocket PC no admite archivos CAB comprimidos o con firma. Los archivos CAB para Smartphone
se deben comprimir y tanto el archivo .exe como el archivo .dll y el propio archivo CAB deben firmarse de forma digital antes
de poderse instalar en el dispositivo. Para obtener más información, vea Seguridad en los proyectos de dispositivos.
Aplicaciones nativas y administradas
La única diferencia entre crear un proyecto CAB de Smart Device para una aplicación escrita en C++ y otra escrita en Visual C#
o Visual Basic es que, con aplicaciones nativas, el usuario debe agregar manualmente las dependencias del sistema, atl80.dll,
mfc80U[d].dll y/o msvcrt[d].dll, al proyecto CAB en cuestión. En el caso de aplicaciones administradas, nunca se deberá
agregar ningún archivo DLL .NET Compact Framework al archivo CAB que se determine. Si se establece como destino la
versión 1.0; a continuación, todos los archivos DLL ya estarán presentes en cualquier dispositivo basado en Windows Mobile
2003SE y versiones posteriores. Si la versión de destino es la versión 2.0 de .NET Compact Framework, será necesario
determinar si el dispositivo ya tiene instalada esa versión. Esto se puede llevar a cabo, creando un archivo DLL de instalación
de Windows CE que comprueba la versión de mscoree.dll en el dispositivo de destino. Si la versión 2.0 del archivo .NET
Compact Framework no está presente, se podrá implementar el proyecto CAB adecuado que se proporciona con Visual Studio
en la siguiente ruta de acceso: Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\WindowsCE. O puede
implementar por separado este proyecto CAB con respecto a su aplicación CAB o incrustarlo en la propia aplicación CAB.
Precaución
Al redistribuir una aplicación nativa vinculada dinámicamente a MFC/ATL e implementar las DLL en tiempo de ejecución de
MFC/ATL en el directorio de la aplicación, es probable que la aplicación no tenga ningún vínculo con las DLL de ese directori
o. En Windows CE, si dos DLL tienen el mimo nombre de archivo pero diferentes rutas de acceso, sólo se cargará la primera
DLL con el nombre de archivo en cuestión. No se cargarán las DLL subsiguientes con el mismo nombre de archivo. En su lug
ar, la aplicación estará vinculada a la DLL con ese nombre de archivo previamente cargada mediante otra aplicación.
Para asegurarse de que la aplicación está vinculada con las DLL de ese directorio, hay que asegurarse de que ninguna otra ap
licación está utilizando ninguna DLL con los mismos nombres de archivo.
En este tutorial, se comienza por cualquier solución de dispositivo inteligente escrita en Visual Basic 2005, Visual C# 2005 o
Visual C++ 2005. Para obtener más información, vea Tutorial: Crear una aplicación simple.
Este tutorial muestra cómo hacer lo siguiente:
Agregar un proyecto Cab a la solución.
Cambiar el nombre de producto.
Cambiar la ruta de acceso de resultados.
Rellenar el archivo CAB con el resultado primario de la aplicación.
Agregar dependencias si es necesario.
Crear un acceso directo a la aplicación.
Editar una entrada del Registro.
Requisitos previos
Solución Smart Device existente. Entre los fines de este tutorial sobre el empaquetado, hay que tener en cuenta la creación y la
generación de un proyecto sencillo, como el proyecto descrito en Tutorial: Crear aplicaciones de Windows Forms para un
dispositivo.
Nota
Los cuadros de diálogo y comandos de menú que se ven pueden diferir de los descritos en la Ayuda, en función de los valore
s de configuración o de edición activos. Para cambiar la configuración, elija la opción Importar y exportar configuraciones
del menú Herramientas. Para obtener más información, vea Valores de configuración de Visual Studio.
Vea también
Tareas
Cómo: Firmar una aplicación de Visual Basic o Visual C# (Dispositivos)
Cómo: Firmar un ensamblado de Visual Basic o Visual C# (Dispositivos)
Cómo: Firmar los resultados del proyecto en un proyecto de Visual C++ (Dispositivos)
Cómo: Firmar un archivo CAB (Dispositivos)
Otros recursos
Seguridad en los proyectos de dispositivos
Desarrollo para Smart Device
Vea también
Otros recursos
Seguridad en los proyectos de dispositivos
Desarrollo para Smart Device
RapiConfig.exe /P /M <securityfile.xml>
Vea también
Otros recursos
Seguridad en los proyectos de dispositivos
Desarrollo para Smart Device
Rapiconfig.exe /P /M <certstorequery.xml>
Para iniciar signtool.exe como un evento posterior a la generación en proyectos de Visual Basic y
Visual C#
1. En el Explorador de soluciones, haga clic con el botón secundario del mouse en el proyecto y haga clic en Propiedades
en el menú contextual.
2. En la página Eventos de generación (Visual C#) o la página Compilar (Visual Basic), haga clic en Edición posterior a
la generación.
3. En el cuadro de diálogo Línea de comandos del evento posterior a la generación, escriba la línea de comandos de
signtool con las opciones de su elección.
Para obtener más información sobre cómo ejecutar signtool desde la línea de comandos, vea SignTool.
Para iniciar signtool.exe como un evento posterior a la generación en proyectos de dispositivos de
Visual C++
1. En el Explorador de soluciones, haga clic con el botón secundario del mouse en el proyecto y haga clic en Propiedades
en el menú contextual.
2. En Propiedades de configuración, expanda el nodo Eventos de generación.
3. Haga clic en Evento posterior a la generación.
4. Seleccione la propiedad Línea de comandos y, a continuación, haga clic en el botón de puntos suspensivos (…) para
abrir el cuadro de diálogo Línea de comandos.
5. Escriba la línea de comandos de signtool con las opciones de su elección.
Para obtener más información sobre cómo ejecutar signtool desde la línea de comandos, vea SignTool.
Vea también
Otros recursos
Seguridad en los proyectos de dispositivos
Desarrollo para Smart Device
Para escribir el tutorial se utilizó la configuración de desarrollo de Visual Basic y la configuración de desarrollo de Visual C#.
El tutorial consta de cinco tareas principales:
Crear un proyecto de dispositivos que utiliza formularios Windows Forms.
Agregar un control al formulario.
Agregar control de eventos al control.
Seleccionar un dispositivo en el que se ejecutará el proyecto.
Compilar e implementar la aplicación en el dispositivo.
Seleccionar un dispositivo de destino
Lleve a cabo el procedimiento siguiente para asegurarse de que se le pedirá seleccionar un dispositivo cuando implemente la
solución.
Para solicitar opciones de dispositivos durante la implementación
1. En el menú Herramientas, haga clic en Opciones, haga clic Herramientas de dispositivo y, a continuación, en
General. Si Herramientas de dispositivo no está visible, seleccione Mostrar todas las configuraciones en la parte
inferior del cuadro de diálogo Opciones.
2. Active la casilla de verificación Mostrar dispositivos antes de implementar un proyecto de dispositivo.
Crear la aplicación
La creación de un proyecto de formulario Windows Forms, así como la adición de controles y del control de eventos, siguen el
mismo proceso en los proyectos para dispositivos que en los proyectos para el escritorio. La diferencia principal radica en el
menor número de clases que están disponibles en .NET Compact Framework.
Para crear un proyecto para dispositivos que utiliza formularios Windows Forms
1. (Visual Basic) En el menú Archivo de Visual Studio 2005, haga clic en Nuevo proyecto.
— o bien —
(Visual C#) En el menú Archivo de Visual Studio 2005, seleccione Nuevo y haga clic en Proyecto.
2. En Tipos de proyecto, en el cuadro de diálogo Nuevo proyecto, expanda Visual Basic o Visual C#, expanda
Dispositivo inteligente y, a continuación, haga clic en Pocket PC 2003.
Si el lenguaje que desea no aparece desde un principio, expanda Otros lenguajes. Su configuración de desarrollo rige
esta pantalla.
3. En Plantillas, haga doble clic en Aplicación de dispositivo.
4. En el cuadro Nombre, escriba DeviceSample y, a continuación, haga clic en Aceptar.
5. (Visual C# sólo) En el cuadro Ubicación, compruebe dónde desea almacenar los archivos de proyecto y, a continuación,
haga clic en Aceptar.
Una representación de un dispositivo Pocket PC aparece en el Diseñador de Windows Forms.
Para agregar un control al formulario
1. En el Cuadro de herramientas, arrastre un control Button al formulario.
Si el Cuadro de herramientas no está visible, haga clic en Cuadro de herramientas en el menú Ver.
Si la ficha Controles de dispositivo no está visible en el Cuadro de herramientas, haga clic con el botón secundario
del mouse en el Cuadro de herramientas y, a continuación, haga clic en Mostrar todo.
2. Haga clic con el botón secundario en el control Button y seleccione Propiedades.
3. En la ventana Propiedades, escriba Say Hello y presione ENTRAR para establecer la propiedad Texto.
Para agregar control de eventos al control Button
1. Haga doble clic en el botón del formulario.
Se abrirá el Editor de código, con el punto de inserción en el controlador de eventos.
2. Inserte el siguiente código de Visual Basic:
MessageBox.Show("Hello, World!")
— o bien —
Inserte el código siguiente de C#:
MessageBox.Show("Hello, World!");
Requisitos previos
Ninguno.
Seleccionar un dispositivo de destino
Lleve a cabo el procedimiento siguiente para asegurarse de que se le pedirá seleccionar un dispositivo cuando implemente la
solución.
Para solicitar opciones de dispositivos durante la implementación
1. En el menú Herramientas, haga clic en Opciones, haga clic en Herramientas de dispositivo y, a continuación, en
General.
Si Herramientas de dispositivo no está visible, seleccione Mostrar todas las configuraciones en la parte inferior del
cuadro de diálogo Opciones.
2. Active la casilla de verificación Mostrar dispositivos antes de implementar un proyecto de dispositivo.
Crear el proyecto
El nombre que se proporciona a un nuevo proyecto también establece el espacio de nombres de la raíz y el nombre de
ensamblado.
Para crear la biblioteca de controles y el control
1. (Visual Basic) En el menú Archivo, haga clic en Nuevo proyecto.
O bien
(Visual C#) En el menú Archivo, elija Nuevo y haga clic en Proyecto.
2. En Tipos de proyecto, en el cuadro de diálogo Nuevo proyecto, expanda Visual Basic o Visual C#, expanda Smart
Device y, a continuación, haga clic en Pocket PC 2003.
Si el lenguaje que desea no aparece desde un principio, expanda Otros lenguajes. Su configuración de desarrollo rige
esta pantalla.
3. En Plantillas, haga clic en Biblioteca de controles.
4. En el cuadro Nombre, escriba ctlDevClockLib.
5. (Visual C# sólo) En el cuadro Ubicación, compruebe dónde desea almacenar los archivos de proyecto.
6. Haga clic en Aceptar.
Aparece el Diseñador de componentes.
Ya ha especificado el nombre del proyecto, el espacio de nombres de la raíz y el nombre de ensamblado (ctlDevClockLib). Sin
embargo, los componentes del proyecto tienen nombres predeterminados asignados por Visual Studio (por ejemplo,
UserControl1). Lo normal es que desee cambiar estos nombres por términos más significativos.
Para cambiar el nombre de la biblioteca y del control.
1. En el Explorador de soluciones, haga clic con el botón secundario del mouse en UserControl1.vb|cs y, a continuación,
haga clic en Propiedades en el menú contextual.
2. Cambie el Nombre de archivo a ctlDevClock.vb|cs.
3. (Sólo Visual C#) En el cuadro de mensaje donde se pregunta si desea cambiar el nombre de todas las referencias a este
elemento de código, haga clic en Sí.
El cambio de nombre en la ventana Propiedades ahora se extiende a otras referencias, como el nombre de clase y el
constructor.
A continuación, agregue componentes del Cuadro de herramientas para proporcionar funcionalidad e interacción con el
usuario al control de usuario. En este tutorial, agregará un control Temporizador para tener acceso a la hora del sistema y un
control Label para mostrar la hora.
Para agregar componentes y cambiar sus propiedades
1. En el Cuadro de herramientas, haga doble clic en Label.
Se agrega un control Label al control de usuario en el Diseñador de componentes.
2. En la ventana Propiedades del control Label, realice las acciones siguientes:
Propiedad Cambie a
Name lblDisplay
TextAlign TopCenter
Font.Size 14
Enabled True
1.
En los pasos siguientes, agregará un controlador de eventos para mostrar los impulsos de reloj en el control Label.
Para agregar un controlador de eventos
1. En la bandeja de componentes, haga doble clic en timer1 para abrir el editor de código en el evento Tick.
2. (Visual Basic) Inserte este código de control de eventos:
— o bien —
(Visual C#)
lblDisplay.Text = DateTime.Now.ToLongTimeString();
3. (Visual Basic) Cambie el modificador de acceso de Private a Protected y agregue la palabra clave Overridable para que
el código del controlador tenga el aspecto siguiente:
— o bien —
(Visual C#) Cambie el modificador de acceso de private a protected y agregue la palabra clave virtual para que el
código del controlador tenga el aspecto siguiente:
Requisitos previos
Base de datos Northwind para SQL Server Mobile Edition (incluida en Visual Studio 2005).
Base de datos Northwind para Microsoft SQL Server 2005 Compact Edition (incluida al instalar SQL Server Compact Edition
para su uso con Visual Studio 2005 SP1).
Nota
Si no es un administrador de su equipo de desarrollo, no podrá abrir el archivo Northwind.sdf en su ubicación predetermin
ada (\Archivos de programa\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0). Copie el archivo en el es
critorio o en Mis documentos y ábralo desde allí cuando se le solicite.
8. Haga clic en Aceptar en el cuadro de mensaje que muestra la conexión satisfactoria y, a continuación, haga clic en
Aceptar para cerrar el cuadro de diálogo Agregar conexión.
9. Cierre la página Elegir la conexión de datos haciendo clic en Siguiente.
10. En el cuadro de mensaje que pregunta si el usuario desea copiar el archivo en el correspondiente proyecto, haga clic en
Sí.
Para seleccionar objetos de base de datos
1. En la página Elija los objetos de base de datos, expanda el nodo Tables y, a continuación, seleccione las tablas
Customers y Orders.
2. Haga clic en Finalizar.
Se crea NorthwindDataset. Puede ver este origen de datos seleccionando Mostrar orígenes de datos en el menú
Datos.
4. Haga clic en la flecha de lista desplegable para esta tabla Orders y seleccione la opción Cuadrícula de datos.
5. Arrastre la tabla Orders desde la ventana Orígenes de datos hasta el formulario del diseñador.
Busque la cuadrícula que aparece en la parte inferior de la ventana.
Probar la aplicación
En esta sección se genera la aplicación, descárguela en el emulador SE de Pocket PC 2003 y compruebe que la aplicación
funciona correctamente.
Para probar la aplicación
1. En el menú Depurar, haga clic en Inicio o Iniciar depuración.
2. En el cuadro de diálogo Implementar, seleccione Emulador SE de Pocket PC 2000 y haga clic en Implementar.
El progreso de la implementación aparece en la barra de estado. La implementación en el emulador puede tardar algún
tiempo.
3. Cuando la aplicación se ejecuta en el emulador, utilice las flechas arriba y abajo del teclado o el control de exploración
NAVIGATION del emulador para cambiar los registros seleccionados en la cuadrícula Customers. Compruebe que los
registros seleccionados cambian en la cuadrícula Orders.
Prepararse para tutoriales adicionales
Si piensa seguir tutoriales adicionales o abrir otros proyectos, deseará cerrar el emulador y salir de esta solución.
Para cerrar el emulador y la solución
1. En el menú Archivo del emulador, haga clic en Salir.
2. En el cuadro de mensaje Emulador de dispositivos, haga clic en No en el mensaje que pregunta si desea guardar el
estado del emulador.
3. En el cuadro de mensaje que indica que se ha perdido la conexión, haga clic en Aceptar.
4. (Visual Basic) En el menú Archivo, haga clic en Cerrar proyecto.
Si se le solicita que guarde el proyecto o la solución, haga clic en Guardar si desea volver a utilizarlo posteriormente; de
no ser así, haga clic en Descartar y los archivos no se guardarán.
— o bien —
(Visual C#) En el menú Archivo, haga clic en Cerrar solución.
Vea también
Tareas
Cómo: Instalar bases de datos de ejemplo
Referencia
Asistente para la configuración de orígenes de datos
Otros recursos
Tutoriales sobre datos
Obtener acceso a datos (Visual Studio)
Desarrollo para Smart Device
Los procedimientos siguientes se han actualizado para SP1 de Visual Studio 2005.
La base de datos instalada varía en función de la versión de Visual Studio que haya instalado:
Microsoft SQL Server Mobile Edition (Visual Studio 2005)
Microsoft SQL Server 2005 Compact Edition (SP1 de Visual Studio 2005)
Requisitos previos
La base de datos Northwind para SQL Server Mobile o SQL Server Compact Edition, incluida en Visual Studio 2005.
Nota
Si no es un administrador de su equipo de desarrollo, no puede abrir el archivo Northwind.sdf en la ubicación predetermin
ada, \Archivos de programa\Microsoft Visual Studio 8\SmartDevices\SDK\SQL Server\Mobile\v3.0. Copie el archivo en el esc
ritorio o en Mis documentos y ábralo desde allí cuando se le solicite.
8. Haga clic en Aceptar en el cuadro de mensaje que muestra la conexión satisfactoria y, a continuación, haga clic en
Aceptar para cerrar el cuadro de diálogo Agregar conexión.
9. Cierre la página Elegir la conexión de datos haciendo clic en Siguiente.
10. En el cuadro de mensaje que pregunta si el usuario desea copiar el archivo en el correspondiente proyecto, haga clic en
Sí.
Para seleccionar objetos de base de datos
1. En la página Elija los objetos de base de datos, expanda el nodo Tables y, a continuación, seleccione la tabla Orders.
2. Haga clic en Finalizar.
Se crea NorthwindDataset. Puede ver este origen de datos seleccionando Mostrar orígenes de datos en el menú
Datos.
8. Haga clic en Aceptar para cerrar el cuadro de diálogo Generador de criterios de búsqueda.
Aparece un panel en el formulario del diseñador.
using HelloCOMObjectLib;
string text;
HelloClass h = new HelloClass();
h.HelloWorld(out text);
MessageBox.Show(text);
Los siguientes procedimientos muestran cómo utilizar cada una de estas técnicas. Para obtener más información, vea
Explicación de código: Código generado por el asistente en proyectos de dispositivos de Visual C++.
Nota
Los cuadros de diálogo y comandos de menú que se ven pueden diferir de los descritos en la Ayuda, en función de la configu
ración activa o la edición. Para cambiar la configuración, elija la opción Importar y exportar configuraciones en el menú H
erramientas. Para obtener más información, vea Valores de configuración de Visual Studio.
Vea también
Tareas
Cómo: Cambiar el dispositivo predeterminado (proyectos nativos)
Utilizar recursos en varias plataformas
Desarrollo para Smart Device
#include "stdafx.h"
#include "MFCHello1.h"
#include "MFCHello1Doc.h"
#include "MFCHello1View.h"
// Configuración Debug.
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNCREATE(CMFCHello1View, CView)
BEGIN_MESSAGE_MAP(CMFCHello1View, CView)
END_MESSAGE_MAP()
Código de construcción. Para obtener más información, vea Diseño de constructores y para el control de excepciones,
vea Controlar excepciones.
// CMFCHello1View construction/destruction
CMFCHello1View::CMFCHello1View()
{
// TODO: add construction code here.
}
CMFCHello1View::~CMFCHello1View()
{
}
MFC PreCreateWindow.
return CView::PreCreateWindow(cs);
}
Conviene recordar que dibujar o pintar en la pantalla es algo que tiene lugar en el método CView::OnDraw. En este
método es posible controlar la interfaz de dispositivos gráficos (GDI), principalmente en el código (CDC* pDC), que se
proporciona como parámetro. No hay que olvidar quitar los comentarios. Por ejemplo, es posible utilizar toda la potencia
de la GDI para cualquier cosa relacionada con el texto para dibujar gráficos en juegos animados de una determinada
aplicación. En este ejemplo de GDI, CDC::DrawTextCDC::El método DrawText se utiliza a continuación para dibujar el texto
de "Hola a todos" dentro del rectángulo definido por CWnd::GetClientRect.
BEGIN_MESSAGE_MAP.
Clase CDC.
GetClientRect.
// CMFCHello1View drawing
void CMFCHello1View::OnDraw(CDC* pDC)
{
CMFCHello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
DrawText y otros métodos relacionados. Para obtener más información, vea CDC Class.
Este tutorial se ha escrito usando los valores de configuración de desarrollo de Visual C++.
Crear un proyecto de control ActiveX MFC multiplataforma de Smart Device
1. En el menú Archivo, elija Nuevo, haga clic en Proyecto, expanda el nodo Visual C++ en el panel Tipos de proyecto y,
a continuación, haga clic en Smart Device.
2. En el panel Plantillas, haga clic en Control ActiveX de Smart Device MFC.
3. En el cuadro Nombre, escriba MFCAX.
4. En el cuadro Solución, acepte la opción predeterminada Crear directorio para la solución.
5. Haga clic en Aceptar para iniciar el Asistente para controles ActiveX de Smart Device MFC.
6. Haga clic en Siguiente en la página de bienvenida del Asistente para aplicaciones de Smart Device MFC. Aparece
Plataformas, Asistente para controles ActiveX de Smart Device MFC y es posible seleccionar la plataforma o plataformas
que se va a agregar al proyecto actual.
En el panel SDK instalados, seleccione las plataformas que se desean tener como destino y agregue el proyecto actual,
como Smartphone 2003 y Pocket PC 2003. Para agregar una plataforma, seleccione la plataforma que aparece en el
panel izquierdo, como Smartphone 2003 y haga clic en el botón con la flecha derecha (>) sobre dicha plataforma. Para
quitar una plataforma, seleccione la plataforma que aparece en el panel derecho, como Pocket PC 2003 y haga clic en el
botón con la flecha izquierda (>) sobre dicha plataforma.
7. Haga clic en Finalizar para finalizar y cerrar el asistente o haga clic en Siguiente para aceptar los valores
predeterminados para todas las opciones restantes en el asistente.
Nota
Habiendo creado un proyecto de dispositivos, siempre puede agregar más plataformas después de la creación inicial. S
in embargo, el hecho de agregar una nueva plataforma a un proyecto existente no implica que se agreguen DLL depen
dientes en tiempo de diseño a la propiedad de configuración Archivos adicionales. Por ejemplo, si la aplicación se vin
cula dinámicamente a MFC, será necesario incluir los siguientes archivos DLL en la propiedad Archivos adicionales d
e la plataforma que se acaba de agregar: Mfc80u.dll, Atl80.dll, Msvcr80.dll. Este ejemplo incluye una configuración com
ercial.
8.
Agregar código al método OnDraw() del control MFC multiplataforma
Para agregar código al método OnDraw de un control ActiveX MFC
1. En Explorador de soluciones, expanda el nodo Archivos de código fuente y seleccione y abra el archivo de código
fuente MFCAXCtrl.cpp en el editor.
2. Reemplace el código del método OnDraw con el siguiente código, especialmente las tres últimas líneas:
void CMFCAXCtrl::OnDraw(
CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
{
if (!pdc)
return;
CRect rect;
GetClientRect(&rect);
pdc->DrawTextW(_T("Hello World"),11, &rect,1);
}
#include "stdafx.h"
#include "stdafx.h"
#include "<PROJECTNAME>.h"
#include "MFCAXCtrl.h"
#include "MFCAX1PropPage.h"
Configuración Debug:
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// Message map
BEGIN_MESSAGE_MAP(CMFCAXCtrl, COleControl)
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
// Dispatch map
BEGIN_DISPATCH_MAP(CMFCAXCtrl, COleControl)
#ifndef WIN32_PLATFORM_WFSP
DISP_FUNCTION_ID(CMFCAXCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VT
S_NONE)
#endif // !WIN32_PLATFORM_WFSP
END_DISPATCH_MAP()
Mapas de eventos MFC. Para obtener más información, vea BEGIN_EVENT_MAP.
// Event map
BEGIN_EVENT_MAP(CMFCAXCtrl, COleControl)
END_EVENT_MAP()
Vea también
Otros recursos
Ejemplos y tutoriales (Proyectos de dispositivos inteligentes)
Desarrollo para Smart Device
Nota
Los controles ActiveX para una plataforma DCOM se deberían marcar como modelo apartamento subprocesado al generars
e. Ésta es la configuración predeterminada del asistente del control ALT. Puede omitir, sin ningún tipo de problema, la advert
encia generada durante la compilación. Los proyectos ATL, GUI y EXE, al igual que ocurre con aquellos a los que se ha agrega
do atlwin.h, atlctl.h o atlhost.h a un proyecto ATL EXE, deberían tener _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA definido
en stdafx.h antes de incluir los archivos de encabezado ATL. Esta práctica es la misma que se realiza cuando se está desarrolla
ndo para el escritorio. Para obtener más información, vea Generar y depurar proyectos de dispositivos de Visual C++.
IDD_<project name>_DIALOG DLGINIT BEGIN IDC_CUSTOM1, 0x376, 22, 0 0x0000, 0x0000, 0x08
00, 0x0000, 0x094d, 0x0000, 0x043d, 0x0000, 0x0013, 0xcdcd, 0xcdcd, 0
8. Genere y ejecute el proyecto host. Recuerde implementar y registrar el control ActiveX en el dispositivo de destino.
Para utilizar un método alternativo para alojar controles ActiveX
1. Registre la clase de ventana AtlAxWin80 llamando a AtlAxWinInit en algún punto de la aplicación. Las aplicaciones ATL
realizan esta operación en el código de inicialización del módulo. Las aplicaciones Win32 deben llamar a esta función en
la función WinMain. Para las aplicaciones MFC, siga estos pasos:
a. Haga clic con el botón secundario del mouse en el Explorador de soluciones y, a continuación, haga clic en
Agregar y en Clase.
b. Haga clic en Agregar compatibilidad de ATL a MFC (bajo el título Dispositivo inteligente).
c. Agregue la llamada AtlAxWinInit al principio del método InitInstance de la clase de aplicación host.
2. En un recurso de cuadro de diálogo (como un cuadro de diálogo o control compuesto de ATL, o un cuadro de diálogo de
MFC):
a. Arrastre un control personalizado desde el Cuadro de herramientas.
b. Establezca la propiedad de clase de ventana en AtlAxWin80.
c. Establezca el título en el GUID entre llaves o en el Id. de programa.
3. Para MFC, agregue atl.lib como entrada de vínculo adicional.
4. Para MFC, agregue estas líneas a la opción Implementación | Archivos adicionales. Estas líneas ya están incluidas
para las bibliotecas de vínculos dinámicos, pero deben agregarse para las bibliotecas de MFC vinculadas estáticamente.
msvcr80.dll|$(BINDIR)\$(INSTRUCTIONSET)\|%CSIDL_PROGRAM_FILES%\$(ProjectName)|0
atl80.dll|$(BINDIR)\$(INSTRUCTIONSET)\|%CSIDL_PROGRAM_FILES%\$(ProjectName)|0
msvcr80d.dll|$(BINDIR)\$(INSTRUCTIONSET)\|%CSIDL_PROGRAM_FILES%\$(ProjectName)|0
Vea también
Otros recursos
Programar para dispositivos con Visual C++
Tutoriales sobre dispositivos inteligentes
Desarrollo para Smart Device
TextEdit Muestra los fundamentos del uso de Microsoft Foundation Classes y proporciona un punto de partida para escribir a
or plicaciones MFC propias.
PoomVi Muestra una interfaz de usuario independiente del dispositivo en un programa que realiza consultas, y muestra todos
ewer los campos de las bases de datos de citas, contactos y tareas.
Para obtener más información sobre estos ejemplos y las funciones que describen, vea el archivo Readme.txt que se incluye
con cada ejemplo.
Vea también
Otros recursos
Ejemplos de dispositivos inteligentes
Desarrollo para Smart Device
Referencia (dispositivos)
En esta sección se ofrece información de referencia para proyectos de dispositivos inteligentes. Las secciones relacionadas
proporcionan los vínculos a los temas de referencia específicos de algunos idiomas para los proyectos de dispositivos.
En esta sección
Referencia de .NET Compact Framework para proyectos de dispositivos
Proporciona información sobre .NET Compact Framework.
Referencia a ATL para dispositivos
Proporciona direcciones para mostrar temas de referencia de ATL admitidos en los proyectos de dispositivos.
Referencia a MFC para dispositivos
Proporciona temas de la referencia de MFC para dispositivos.
Referencia de la biblioteca en tiempo de ejecución de C para dispositivos
Proporciona temas de referencia de la biblioteca en tiempo de ejecución de C para dispositivos.
Referencia de la Biblioteca estándar de C++ para dispositivos
Proporciona temas de referencia del subconjunto de la biblioteca de C++ estándar disponible para el desarrollo de
aplicaciones para dispositivos.
Compilers for Smart Devices
Describe los procesadores ARM, Renesas y los de la gama MIPS, y enumera las diferencias entre los compiladores de
escritorio y los de dispositivos.
Referencia de la interfaz de usuario para dispositivos
Muestra una lista de los elementos de interfaz disponibles de manera exclusiva para el desarrollo de aplicaciones para
dispositivos inteligentes.
Referencia del lenguaje Visual Basic para dispositivos
Resume las diferencias entre los elementos de programación disponibles en Visual Basic para los proyectos de dispositivos
inteligentes.
Mensajes de error (Dispositivos)
Proporciona información sobre cómo resolver problemas de errores concretos.
Vea también
Otros recursos
Desarrollo de dispositivos inteligentes
Desarrollo para Smart Device
Vea también
Tareas
Cómo: Encontrar la Ayuda para los métodos y clases MFC compatibles con dispositivos
Conceptos
Filtros de Ayuda para Visual Studio
Otros recursos
Introducción a los proyectos para Smart Device
Desarrollo para Smart Device
CAtlCEValidateThreadIDDefault (Clase)
Introduce la clase CAtlCEValidateThreadIDDefault, que proporciona macros relacionadas con subprocesos y métodos
únicos de los proyectos de dispositivos.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en atlcore.h.
Vea también
Conceptos
CAtlCEValidateThreadIDDefault (Métodos)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
CAtlCEValidateThreadIDDefault (Métodos)
La tabla siguiente contiene la lista de los métodos CAtlCEValidateThreadIDDefault:
CAtlCEValidateThreadIDDefault::Va Indica si el identificador de un subproceso que se utiliza para controlar el subproceso de lla
lidate mada es el mismo que el del subproceso de llamada original o es distinto.
Vea también
Conceptos
CAtlCEValidateThreadIDDefault (Clase)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
CAtlCEValidateThreadIDDefault::CAtlCEValidateThreadIDDefault
Crea una instancia de un objeto CAtlCEValidateThreadIDDefault y establece el miembro de datos privados m_ThreadId en el
identificador de subproceso actual, que se utiliza como controlador del subproceso de llamada.
CAtlCEValidateThreadIDDefault();
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en atlcore.h.
Vea también
Conceptos
CAtlCEValidateThreadIDDefault (Métodos)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
CAtlCEValidateThreadIDDefault::Validate
Indica si el identificador de un subproceso que se utiliza para controlar el subproceso de llamada es el mismo que el del
subproceso de llamada original o es distinto.
Valor devuelto
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en atlcore.h.
Vea también
Conceptos
CAtlCEValidateThreadIDDefault (Métodos)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
CE_VALIDATE_THREADID_ASSERT (Macro)
En las versiones de depuración, CE_VALIDATE_THREADID_ASSERT genera un informe de depuración cuando el método
CAtlCEValidateThreadIDDefault::Validate devuelve el valor falso.
CE_VALIDATE_THREADID_ASSERT();
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en atlcore.h.
Vea también
Conceptos
CAtlCEValidateThreadIDDefault (Métodos)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
CE_VALIDATE_THREADID_RETURN (Macro)
Devuelve el parámetro de la macro si se valida el identificador del subproceso.
CE_VALIDATE_THREADID_RETURN(r);
Parámetros
En la tabla siguiente, se describe el parámetro de la macro CE_VALIDATE_THREADID_RETURN de la clase
CAtlCEValidateThreadIDDefault.
Parámetro Descripción
r El parámetro que se devuelve si se valida el subproceso.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en atlcore.h.
Vea también
Referencia
CAtlCEValidateThreadIDDefault::Validate
Conceptos
CAtlCEValidateThreadIDDefault (Métodos)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
CE_VALIDATE_THREADID_THROW (Macro)
Inicia una excepción si se valida el identificador del subproceso.
CE_VALIDATE_THREADID_THROW(e);
Parámetros
En la tabla siguiente, se describe el parámetro de la macro CE_VALIDATE_THREADID_THROW de la clase
CAtlCEValidateThreadIDDefault.
Parámetro Descripción
e Excepción que se produce.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en atlcore.h.
Vea también
Referencia
CAtlCEValidateThreadIDDefault::Validate
Conceptos
CAtlCEValidateThreadIDDefault (Métodos)
Otros recursos
ATL única para clases de dispositivos
Desarrollo para Smart Device
Vea también
Conceptos
Diferencias entre MFC C++ para dispositivos y MFC estándar
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
Clases de la versión MFC 7.0 estándar para escritorio no admitidas en MFC para dispositivos 8.0
Clasificación de clases
Vea también
Otros recursos
Referencia a MFC para dispositivos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar (Clase)
Esta clase permite crear y modificar barras de comandos. Una barra de comandos es una barra de herramientas que puede
incluir una barra de menús así como un botón Cerrar, un botón Ayuda y el botón Aceptar. Una barra de comandos puede
contener menús, cuadros combinados, botones y separadores. Un separador es un espacio en blanco que se utiliza para dividir
otros elementos en grupos o para reservar espacio en una barra de comandos. Después de crear un objeto CCommandBar,
utilice los métodos InsertMenuBar, InsertComboBox e InsertSeparator para insertar barras de menús, cuadros combinados y
separadores, respectivamente. Una vez finalizada la inclusión de todos estos elementos en la barra de comandos, utilice el
método AddAdornments para agregar el botón Cancelar y, opcionalmente, los botones Ayuda y Aceptar. Utilice el método
DrawMenuBar para cambiar el diseño de la barra de comandos cada vez que modifique un menú en la barra de comandos.
En Windows CE 5.0 ya no se admite el miembro CDialog::m_pWndEmptyCB y el usuario controla los procesos de creación y
de inserción. Anteriormente, esta variable miembro se utilizaba para señalar los objetos CommandBar o MenuBar vacíos en
Pocket PC.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar (Métodos)
En la tabla siguiente se enumeran los métodos CCommandBar.
CCommandBar::AddAdorn Agrega un botón Cerrar y, opcionalmente, los botones Ayuda y Aceptar a la barra de comandos.
ments
CCommandBar::AddBitma Agrega una o más imágenes a la lista de imágenes de botones disponibles para utilizarse en la barr
p a de comandos.
CCommandBar::DrawMen Cambia la posición y el diseño de la barra de comandos después de que se modifique un menú en
uBar la barra de comandos.
CCeDocList La clase ha pasado a ser CDocList (Clase) en MFC 8.0. A continuación se muestra código de una aplicación de MFC
3.0:
CCommandBar::AddAdornments
Agrega un botón Cerrar y, opcionalmente, los botones Ayuda y Aceptar a la barra de comandos.
BOOL AddAdornments(
Dword dwFlags = 0 );
Parámetros
En la tabla siguiente se describen los parámetros del método AddAdornments de CCommandBar (Clase).
Pará Descripción
metr
o
dwFla Especifica los botones opcionales que se van a agregar a la barra de comandos. El valor es cero si sólo se necesita el bot
gs ón Cerrar, o una combinación de los valores siguientes para crear botones adicionales:
Valor Descripción
CMDBAR Agrega un botón Ayuda a la barra de comandos. Cuando se hace clic en él, este botón envía un mensaje W
_HELP M_HELP.
CMDBAR Agrega un botón Aceptar a la barra de comandos. Cuando se selecciona, este botón envía un mensaje WM_
_OK COMMAND con IDOK como identificador del mensaje.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Comentarios
Este método crea un mínimo de dos botones: un separador que alinea las opciones gráficas seleccionadas a la derecha de la
barra de comandos, y las opciones gráficas seleccionadas.
Cuando un usuario hace clic en el botón Cerrar, Aceptar o Ayuda, el mensaje asociado al botón en cuestión se coloca en la
cola de mensajes de la aplicación. Todas las barras de comandos deben tener un botón Cerrar. Los botones Aceptar y Ayuda
son opcionales.
Llame a este método después de agregar a la barra de comandos el resto de elementos como menús, botones y cuadros
combinados.
Las aplicaciones existentes se deben volver a diseñar para eliminar la dependencia de AddAdornments.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar::AddBitmap
Agrega una o más imágenes a la lista de imágenes de botón disponibles en la barra de comandos.
int AddBitmap (
int nBitMapID,
int nNumImages );
Parámetros
En la tabla siguiente se describen los parámetros del método AddBitmap de CCommandBar (Clase).
nBitMapID
Especifica el identificador de recursos del mapa de bits que contiene la imagen o imágenes de botón que se van a agregar.
nNumImages
Especifica el número de imágenes de botón del mapa de bits.
Valores devueltos
Índice de base cero de la primera imagen nueva si se realizó correctamente; en caso contrario, -1.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar::AddButtons
Agrega uno o más botones a un control de barra de herramientas.
BOOL AddButtons(
UINT uNumButtons,
LPTBBUTTON lpButtons );
Parámetros
En la tabla siguiente se describen los parámetros del método AddButtons de CCommandBar (Clase).
uNumButtons
Especifica el número de botones que se van a agregar.
lpButtons
Especifica la dirección de una matriz de estructuras TBBUTTON que contiene información sobre los botones que se van a
agregar. El número de elementos de la matriz debe ser igual al número de botones especificado en nNumButtons.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Comentarios
El puntero lpButtons señala una matriz de estructuras TBBUTTON.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::CCommandBar
Crea una instancia de un objeto CCommandBar.
CCommandBar ( );
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar::Create
Crea instancias de una nueva barra de comandos.
BOOL CommandBar::Create(
CWnd* pWndParent,
DWORD dwStyle,
UINT nBarID = AFX_IDW_TOOLBAR
);
Parámetros
En la tabla siguiente se describen los parámetros del método Create de CCommandBar (Clase).
pWndParent
Puntero del elemento primario del objeto de barra de comandos.
dwStyle
Especifica el estilo de la barra de comandos. Ver comentarios.
nBarID
Parámetro opcional. Especifica el Id. de la ventana secundaria de la barra de herramientas = AFX_IDW_TOOLBAR.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Comentarios
La función Create crea una barra de comandos vacía. En Pocket PC y Smartphones, la barra de comandos se crea en la parte
inferior de la ventana. En Windows CE 5.0 ya no se admite el miembro CDialog::m_pWndEmptyCB, y el usuario controla los
procesos de creación y de inserción. Anteriormente, esta variable miembro se utilizaba para señalar los objetos CommandBar
o MenuBar vacíos en Pocket PC.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar::DrawMenuBar
Cambia la posición y el diseño de la barra de comandos después de que se modifique un menú en la barra de comandos.
BOOL DrawMenuBar(
WORD wButton )
const;
Parámetros
En la tabla siguiente se describe el parámetro del método DrawMenuBar de CCommandBar (Clase).
wButton
Especifica el índice de base cero de la barra de menús en la barra de comandos.
Valor devuelto
true si se realizó correctamente; en caso contrario, false.
Comentarios
Llame siempre a este método después de modificar un menú en una barra de comandos.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::GetMenu
Recupera el identificador de un menú en la barra de comandos.
HMENU CommandBar_GetMenu();
Valores devueltos
El identificador del menú indica la correcta realización. NULL indica el error.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::Height
Recupera el alto de la barra de comandos en píxeles.
int Height();
Valor devuelto
Devuelve el alto de la barra de comandos en píxeles.
Comentarios
La barra de comandos ocupar una parte del área del cliente de la ventana principal de la aplicación; se puede llamar a esta
función como medio para determinar el tamaño real del área de cliente.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CCommandBar::InsertButton
Agrega uno o más botones a un control de barra de herramientas.
BOOL InsertButton(
int nButton,
LPTBBUTTON lpButton );
Parámetros
En la tabla siguiente se describen los parámetros del método InsertButton de CCommandBar (Clase).
nButton
Especifica el índice de base cero de un botón. Este método inserta el nuevo botón a la izquierda de este botón.
lpButton
Especifica la dirección de una estructura TBUTTON que contiene información sobre el botón que se va a insertar.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Comentarios
El puntero lpButton señala una estructura TBUTTON.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::InsertComboBox
Inserta un cuadro combinado en la barra de comandos.
CComboBox* InsertComboBox(
int nWidth,
DWORD dwStyle,
WORD wComboBoxID,
WORD wButton );
Parámetros
En la tabla siguiente se describen los parámetros del método InsertComboBox de CCommandBar (Clase).
nWidth
Especifica el ancho en píxeles del cuadro combinado.
dwStyle
Especifica qué estilos de ventana se aplican al cuadro combinado. Los estilos WS_VISIBLE y WS_CHILD se aplican
automáticamente. Los estilos predeterminados son CBS_DROPDOWNLIST y WS_SCROLL.
wComboBoxID
Especifica el identificador del cuadro combinado.
wButton
Especifica el índice de base cero de un botón en la barra de comandos.
Valores devueltos
Un puntero al menú identificado por wComboBoxID si se realiza correctamente; en caso contrario, null.
Comentarios
Este método inserta el cuadro combinado a la izquierda del botón identificado por wButton.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::InsertMenuBar
Inserta una barra de menús en la barra de comandos.
BOOL InsertMenuBar(
WORD wMenuID,
WORD wButton );
Parámetros
En la tabla siguiente se describen los parámetros del método InsertMenuBar de CCommandBar (Clase).
wMenuID
Especifica el identificador de recursos de MenuBar.
wButton
Especifica el índice de base cero de un botón en la barra de comandos.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Comentarios
Este método coloca MenuBar en la posición del botón indicada por wButton.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::InsertSeparator
Inserta un botón separador en la barra de comandos.
BOOL InsertSeparator(
int nWidth = 6,
WORD wButton );
Parámetros
En la tabla siguiente se describen los parámetros del método InsertSeparator de CCommandBar (Clase).
nWidth
Especifica el ancho en píxeles del botón separador.
wButton
Especifica el índice de base cero de un botón de la barra de comandos que es mayor o igual que cero y menor que el número
de botones de la barra. CMDBAR_END especifica el final de CommandBar.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Comentarios
Este método coloca el separador en la posición del botón indicada por wButton. Un separador no recibe datos proporcionados
por el usuario.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CCommandBar::Show
Muestra u oculta la barra de comandos.
Parámetros
En la tabla siguiente, se describe el parámetro del método Show de CCommandBar (Clase).
bShow
Valor booleano que especifica si se va a mostrar u ocultar la barra de comandos. Establezca este parámetro en false para
mostrar la barra de comandos, o en true para ocultarlo.
Valor devuelto
Devuelve el estado de la presentación anterior de CCommandBar. Devuelve true si se muestra la barra de comandos y false
si se oculta.
Comentarios
Las barras de comandos se crean con el estado de presentación establecido en true. Para ocultar la barra de comandos, llame
a Show(false).
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CCommandBar (Métodos)
Otros recursos
MFC única para clases de dispositivos
CCeCommandBar
Desarrollo para Smart Device
CDocList (Clase)
Utilice CDocList para mostrar listas de documentos de forma coherente. La clase CDocList encapsula la implementación del
sistema operativo del tipo de ventana DocList, con funciones adicionales para la integración con una arquitectura
documento/vista de MFC.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Otros recursos
MFC única para clases de dispositivos
CDocList (Métodos)
CCeDocList
Desarrollo para Smart Device
CDocList (Métodos)
A continuación se enumeran los métodos de CDocList (Clase) que encapsula la implementación del sistema operativo del tipo
de ventana DocList.
CDocList::GetFilterIndex Obtiene la selección de filtros de archivo actuales, por ejemplo, para establecer el filtro actual par
a un cuadro combinado.
CDocList::RenameMoveSele Muestra el cuadro de diálogo Cambiar nombre o mover para los elementos seleccionados.
ctedItems
CDocList::SetFilterIndex Indica que se ha cambiado el filtro de archivo; por ejemplo, el usuario ha cambiado valores en un
cuadro de diálogo Opciones.
CDocList::SetSelectedPathna Hace que el elemento asociado a la ruta de acceso se seleccione durante la siguiente actualizació
me n.
CDocList::SetSelection Selecciona un elemento por índice.
CCeDocList pasa a denominarse CDocList (Clase) en MFC 8.0. A continuación se muestra código de una aplicación de MFC 3.0:
CDocList::CDocList
Crea una instancia de un objeto CDocList.
CDocList();
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::Create
Crea e inicializa la lista asociada al objeto CDocList.
BOOL Create (
CWnd* pParentWnd,
LPCTSTR lpszFilterList,
LPCTSTR lpszFolder,
DWORD dwFlags = DLF_SHOWEXTENSION ) ;
Parámetros
En la tabla siguiente se describen los parámetros del método Create de CDocList (Clase).
Parámetro Descripción
pParentWnd Puntero a la ventana primaria: necesario.
lpszFilterList Puntero a la lista de filtros; una barra vertical (|) delimita la lista y finaliza con ||\0.
CDocList::DeleteSelection
Elimina los elementos seleccionados.
HRESULT DeleteSelection();
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::DisableUpdate
Deshabilita la actualización de doclist.
void DisableUpdate();
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::EnableUpdate
Habilita la actualización de doclist.
void EnableUpdate();
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::GetFilterIndex
Obtiene la selección de filtro de archivo actual.
int GetFilterIndex();
Valor devuelto
El índice de la lista de filtros delimitada por barras verticales (|) para la selección de filtro actual. El índice no es de base cero,
sino de base uno.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::GetItemCount
Obtiene el recuento de elementos.
int GetItemCount();
Valor devuelto
El número de documentos de la lista de documentos.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::GetNextItem
Obtiene el siguiente elemento de la lista de documentos.
int GetNextItem(
int nStart,
UINT nFlags );
Parámetros
En la tabla siguiente se describen los parámetros del método GetNextItem de CDocList (Clase).
Parám Descripción
etro
nStart Especifica el número del elemento en la lista de documentos para iniciar la búsqueda.
nFlags Especifica la relación geométrica del elemento solicitado con el elemento especificado y el estado del elemento solicita
do. La relación geométrica puede ser uno de estos valores:
Valor Descripción
LVNI_ABOVE Busca un elemento que está encima del elemento especificado.
Además, se puede especificar el estado del elemento, que puede ser cero, o puede ser uno o más de los valores siguie
ntes:
Valor Descripción
LVNI_DROPHILITED El elemento tiene establecido el indicador de estado LVIS_DROPHILITED.
Comentarios
Si un elemento no tiene establecidos todos los indicadores de estado especificados, la búsqueda continúa con el siguiente
elemento.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::GetNextWaveFile
Obtiene el archivo .wav siguiente.
BOOL GetNextWaveFile(
int* pnItem );
Parámetros
En la tabla siguiente se describe el parámetro del método GetNextWaveFile de CDocList (Clase).
Parámetro Descripción
pnItem Puntero al archivo .wav siguiente de la lista.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::GetPrevWaveFile
Obtiene el archivo .wav anterior.
BOOL GetPrevWaveFile(
int* pnItem );
Parámetros
En la tabla siguiente se describe el parámetro del método GetPrevWaveFile de CDocList (Clase).
Parámetro Descripción
pnItem Puntero al archivo .wav anterior de la lista.
Valor devuelto
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::GetSelectCount
Obtiene el número de elementos seleccionados.
int GetSelectCount();
Valor devuelto
El número de elementos seleccionados en la lista de documentos.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::GetSelectedPathname
Obtiene la ruta de acceso asociada al elemento seleccionado.
BOOL GetSelectedPathname(
LPTSTR pszPath,
WORD nSize );
Parámetros
En la tabla siguiente se describen los parámetros del método GetSelectedPathname de CDocList (Clase).
pszPath
Puntero a la ruta de acceso del elemento seleccionado en la lista de documentos.
nSize
Especifica la longitud, en caracteres, del búfer que recibe la ruta de acceso.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::ReceiveIR
Se utiliza para recibir información sobre infrarrojos.
void ReceiveIR(
LPTSTR pszPath );
Parámetros
En la tabla siguiente se describe el parámetro del método ReceiveIR de CDocList (Clase).
pszPath
Puntero a la cadena que contiene la ruta de acceso.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::Refresh
Actualiza la lista de documentos.
BOOL Refresh();
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::RenameMoveSelectedItems
Muestra el cuadro de diálogo Cambiar nombre o mover para los elementos seleccionados.
BOOL RenameMoveSelectedItems();
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::SelectItem
Hace que se seleccione el elemento asociado a la ruta de acceso.
HRESULT SelectItem(
LPTSTR pszPath,
BOOL fVisible );
Parámetros
En la tabla siguiente se describen los parámetros del método SelectItem de CDocList (Clase).
Parámetro Descripción
pszPath Puntero a la cadena que contiene la ruta de acceso.
CDocList::SendEMail
Se utiliza para enviar el correo electrónico.
void SendEMail(
LPTSTR pszPath );
Parámetros
En la tabla siguiente se describe el parámetro del método SendEMail de CDocList (Clase).
Parámetro Descripción
pszPath Puntero a la cadena que contiene la ruta de acceso.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::SendIR
Se utiliza para enviar información sobre infrarrojos.
void SendIR(
LPTSTR pszPath );
Parámetros
En la tabla siguiente se describe el parámetro del método SendIR de CDocList (Clase).
Parámetro Descripción
pszPath Puntero a la cadena que contiene la ruta de acceso.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::SetFilterIndex
Indica que se ha cambiado un filtro de archivo.
HRESULT SetFilterIndex(
int nIndex );
Parámetros
En la tabla siguiente se describe el parámetro del método SetFilterIndex de CDocList (Clase).
Parámetro Descripción
nIndex Índice de la lista de filtros delimitada por barras verticales (|). El índice no es de base cero, sino de base uno.
Valor devuelto
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::SetFolder
Establece una carpeta.
void SetFolder(
LPTSTR pszFolder );
Parámetros
En la tabla siguiente se describe el parámetro del método SetFolder de CDocList (Clase).
Parámetro Descripción
pszFolder Puntero a la cadena que contiene el nombre de la carpeta.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::SetItemState
Cambia el estado de un elemento en la lista de documentos.
BOOL SetItemState(
int nItem,
UINT nState,
UINT nStateMask );
Parámetros
En la tabla siguiente se describen los parámetros del método SetItemState de CDocList (Clase).
Parámetro Descripción
nItem Numero de índice para el elemento.
CDocList::SetSelectedPathname
Hace que el elemento asociado a la ruta de acceso se seleccione durante la siguiente actualización.
void SetSelectedPathname(
LPTSTR pszPath );
Parámetros
En la tabla siguiente se describe el parámetro del método SetSelectedPathname de CDocList (Clase).
Parámetro Descripción
pszPath Puntero a la cadena que contiene la ruta de acceso.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::SetSelection
Selecciona un elemento por índice.
BOOL SetSelection(
int wItem );
Parámetros
En la tabla siguiente se describe el parámetro del método SetSelection de CDocList (Clase).
Parámetro Descripción
wItem Numero de índice para el elemento.
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocList::SetSortOrder
Ordena la lista de documentos. El criterio de ordenación siempre es ascendente.
BOOL SetSortOrder();
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocList::Update
Actualiza la lista de documentos pero no restaura la selección.
HRESULT Update();
Valores devueltos
true si se realizó correctamente; en caso contrario, false.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Referencia
CDocList (Clase)
Otros recursos
MFC única para clases de dispositivos
CCeDocList
Desarrollo para Smart Device
CDocListDocTemplate (Clase)
Esta clase es un perfeccionamiento del tipo de aplicación de SDI facilitado por CSingleDocTemplate Class. El uso de esta clase
permite a una aplicación existir en modo DocList cuando no hay ningún documento abierto.
Después de agregar este tipo de documento a la aplicación, se ha de llamar al miembro de ShowDocList para crear
inicialmente una instancia de la clase CDocList.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxext.h.
Vea también
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
CDocListDocTemplate (Métodos)
CDocListDocTemplate (Clase) es una clase similar a la clase CDocListDocTemplate de escritorio que es un perfeccionamiento
del tipo de aplicación de SDI.
Esta clase permite que una aplicación exista en modo de documento cuando no hay ningún documento presente.
Después de agregar este tipo de documento a la aplicación, llame al miembro ShowDocList para crear una instancia de
CDocList.
En esta sección
CDocListDocTemplate::CDocListDocTemplate
Crea un objeto CDocListDocTemplate.
CDocListDocTemplate::ShowDocList
Muestra la lista de documentos. CDocList se crea automáticamente cuando se llama a
CDocListDocTempate::ShowDocList.
Vea también
Otros recursos
MFC única para clases de dispositivos
CCeDocListDocTemplate
Desarrollo para Smart Device
CDocListDocTemplate::CDocListDocTemplate
Crea un objeto CDocListDocTemplate. El uso de esta clase permite asignar dinámicamente un objeto
CDocListDocTemplate y pasarlo a CWinApp::AddDocTemplate desde el método InitInstance de la clase de aplicación.
CDocListDocTemplate(
UINT nIDResource,
CRuntimeClass* pDocClass,
CRuntimeClass* pFrameClass,
CRuntimeClass* pViewClass,
LPCTSTR lpszFilterList,
LPCTSTR lpszFolder );
Parámetros
En la tabla siguiente se describen los parámetros del método CDocListDocTemplate de CDocListDocTemplate (Clase).
Pará Descripción
metr
o
nIDRe Especifica el identificador de los recursos utilizados con el tipo de documento. Pueden ser recursos de menú, icono, tabl
sourc a de aceleradores y cadena.
e
pDoc Puntero al objeto CRuntimeClass de la clase de documento. Esta clase es una clase derivada de CDocument que se de
Class fine para representar los documentos.
pFra Puntero al objeto CRuntimeClass de la clase de ventana de marco. Esta clase puede ser una clase derivada de CFrame
meCl Wnd o puede ser CFrameWnd si se desea el comportamiento predeterminado para la ventana de marco principal.
ass
pView Puntero al objeto CRuntimeClass de la clase de vista. Esta clase es una clase derivada de CView que se define para mo
Class strar los documentos.
lpszFil Puntero a la lista de filtros; una barra vertical (|) delimita la lista y finaliza con ||\0.
terList
CDocListDocTemplate::ShowDocList
Se utiliza como una llamada desde CWinApp::InitInstance para mostrar inicialmente la lista de documentos.
Requisitos
Versiones de Windows CE 5.0 y posteriores.
Archivo de encabezado: declarado en Afxwin.h.
Vea también
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
AfxEnableDRA
Esta función habilita el conocimiento de la resolución de dispositivos en los proyectos de aplicaciones de dispositivos.
Parámetros
bEnable
Al especificar TRUE, se habilita el conocimiento de la resolución de dispositivos; al especificar FALSE o al no llamar a la
función, se deshabilita dicho conocimiento.
Comentarios
Esta característica permite a la aplicación responder a los cambios que se producen en la resolución en tiempo de ejecución,
como el cambio del modo vertical al modo horizontal.
Utilice la función AfxEnableDRA() cuando cree directamente instancias de CDialog. En esta situación, se utiliza el método
OnSize definido en dlgcore.cpp e implementado en LIB y DLL de MFC. En estas versiones de la biblioteca, se utiliza
AfxIsDRAEnabled() para realizar una comprobación en tiempo de ejecución con el fin de determinar si se va a llamar a
DRA::RelayoutDialog(...). AfxIsDRAEnabled() devuelve true únicamente si se ha llamado anteriormente a
AfxEnableDRA(TRUE).
Nota
Cuando utiliza asistentes para crear un proyecto de MFC para dispositivos, el código generado implementa un reemplazo (C
Dialog::OnSize(int, int)) para las clases derivadas de CDialog. El conocimiento de la resolución de dispositivos se comprue
ba en tiempo de compilación y se adopta la decisión de llamar o no a DRA::RelayoutDialog(...).
Ejemplo
AfxEnableDRA(TRUE); //Enable Device Resolution Awareness
...
void CDialog::OnSize(UINT nType, int cx, int cy)
{
if (AfxIsDRAEnabled())
{
DRA::RelayoutDialog(
AfxGetInstanceHandle(),
this->m_hWnd,
DRA::GetDisplayMode() != DRA::Portrait ?
m_lpszWideTemplateName : m_lpszTemplateName);
}
else
{
CWnd::OnSize(nType, cx, cy);
}
}
Vea también
Otros recursos
MFC única para clases de dispositivos
Desarrollo para Smart Device
_i64toa_s _gmtime64_s
Vea también
Otros recursos
Referencia (dispositivos)
Desarrollo para Smart Device
Provides information about Renesas technology compiler options, intrinsic functions, and call specifications.
MIPS Family Processors
Provides information about MIPS technology compiler options, intrinsic functions, and call specifications.
Smart Device Development
/GS - Enable Security Checks Enables stack checking to detect buffer overrun attacks.
In addition, each supported microprocessor family has processor-specific compiler options that implement unique
functionality.
See Also
Reference
ARM Compiler Options
Renesas Compiler Options
MIPS Compiler Options
Smart Device Development
int main()
{
double d0 = 2.0, d1 = 4.0, result;
// No profiling for printf, because the library
// function is not compiled with /callcap.
printf("\n");
// callcap profiling hooks are called
// after the function is entered and before
// leaving it.
// The following example shows how to insert profiling hooks.
// File: callcaphooks.c
#include <stdio.h>
int main();
void _CAP_Enter_Function(void *p)
{
if (p != main)
printf("Enter function (at address %p) at %d\n",
p, GetTickCount());
return;
}
void _CAP_Exit_Function(void *p)
{
if (p != main)
printf("Leaving function (at address %p) at %d\n",
p, GetTickCount());
return;
}
See Also
Concepts
Unique Build Options
Smart Device Development
#include <cstring>
// Vulnerable function
void vulnerable(const char *str)
{
char buffer[10];
strcpy(buffer, str); // overrun buffer !!!
}
int main()
{
// declare buffer that is bigger than expected
char large_buffer[] = "This string is longer than 10 characters!!!";
vulnerable(large_buffer);
}
Remarks
Buffer overruns are more easily exploited on machines, such as x86, with calling conventions that pass the return address of
function calls on the stack.
To prevent buffer overrun exploitation when a function is compiled with /GS, the compiler identifies functions that might be
subject to buffer overrun problems, and inserts a security cookie on the stack before the associated return address. If, on
function exit, the security cookie has changed, then the compiler reports an error and terminates the process.
When working on smart devices, however, the security cookie can become an issue. If an EXE or DLL that does not use one of
the default CRT entry points, but instead calls _cinit through CRT startup code, the compiler will report an error because _cinit
resets the expected value of the security cookie. If _cinit changes the value of the security cookie, the compiler falsely detects a
buffer overrun, reports the error, and terminates the process.
To avoid this issue:
Do not use arrays or _alloca in any functions that call _cinit.
Initialize the CRT normally with a default entry point, such as WinMainCRTStartup or _DllMainCRTStartup.
/GS does not protect against all buffer overrun security attacks. For example, buffer overrun attacks are still possible by
overwriting into the parameters area.
Even if you use /GS, you should strive to write secure code. That is, make sure that your code has no buffer overruns. You can
inject security checks into compiled code by enforcing buffer size restrictions.
See Also
Other Resources
Differences Between Desktop and Device Compilers
Smart Device Development
/EP (Preprocess to stdout Without #line Direc /F (Set Stack Size) /FA, /Fa (Listing File)
tives)
/Fd (Program Database File Name) /Fe (Name EXE File) /FI (Name Forced Include File)
/Fm (Name Mapfile) /Fo (Object File Name) /Fp (Name .pch File)
/FR, /Fr (Create .sbr File) /GF (Eliminate Duplicate Strings)) /GL (Whole Program Optimization)
/GR (Enable Run-Time Type Information) /GX (Enable Exception Handling) /Gy (Enable Function-Level Linking)
/GZ (Enable Stack Frame Run-Time Error Che /H (Restrict Length of External Na /HELP (Compiler Command-Line Help)
cking) mes)
/I (Additional Include Directories) /J (Default char Type Is unsigned) /link (Pass Options to Linker)
/MD, /MT, /LD (Use Run-Time Library) /nologo (Suppress Startup Banne /O1, /O2 (Minimize Size, Maximize Speed)
r) (C/C++)
/Ob (Inline Function Expansion) /Od (Disable (Debug)) /Og (Global Optimizations)
/Oi (Generate Intrinsic Functions) /Os, /Ot (Favor Small Code, Favor /Ox (Full Optimization)
Fast Code)
/P (Preprocess to a File) /RTC (Run-Time Error Checks) /showIncludes (List Include Files)
/Tc, /Tp, /TC, /TP (Specify Source File Type) /U, /u (Undefine Symbols) /V (Version Number)
/vd (Disable Construction Displacements) /vmb, /vmg (Representation Meth /vmm, /vms, /vmv (General Purpose Represe
od) ntation)
/w, /Wn, /WX, /Wall, /wln, /wdn, /wen, /won ( /WL (Enable One-Line Diagnostic /Wp64 (Detect 64-Bit Portability Issues)
Warning Level) s)
/X (Ignore Standard Include Paths) /Y (Precompiled Headers) /Yc (Create Precompiled Header File)
/Yd (Place Debug Information in Object File) /Yu (Use Precompiled Header File /YX (Automatic Use of Precompiled Headers)
)
/Z7, /Zd, /Zi, /ZI (Debug Information Format) /Za, /Ze (Disable Language Extens /Zc (Conformance)
ions)
/Zg (Generate Function Prototypes) /Zl (Omit Default Library Name) /Zm (Specify Precompiled Header Memory Al
location Limit)
_debugbreak
_debugbreak
This function causes a debug breakpoint exception to be inserted.
Parameters
None.
Return Values
None.
Remarks
The breakpoint transfers control to the exception handler.
Requirements
Routine Required header Architecture
_debugbreak <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_prefetch
_prefetch
This function loads the data cache from main memory, if possible.
Parameters
*
[in] Pointer to cache line.
Return Value
None.
Remarks
This function might do nothing if the requested functionality is not available on the target hardware platform.
Requirements
Routine Required header Architecture
_prefetch <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
__trap
__trap
This function inserts a trap instruction.
Parameters
arg1
[in] The trap number.
Return Value
The integer value provided by the trap handler. If the trap handler provides no return value, the return value is undefined.
Remarks
The compiler backend can enforce restrictions on the arguments, including the trap number, and can define a special calling
convention for the trap.
The interpretation of the trap number and the actions taken by the trap handler are not defined.
Requirements
Routine Required header Architecture
__trap <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CacheRelease
_CacheRelease
This function writes the cache line containing the address referenced by the pointer to main memory, and then marks the
cache line as empty.
Parameters
*
[in] Pointer to cache line.
Return Value
None.
Remarks
This function might do nothing if the requested functionality is not available on the target hardware platform.
Requirements
Routine Required header Architecture
_CacheRelease <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CacheWriteBack
_CacheWriteBack
This function writes the cache line containing the address referenced by the pointer to main memory.
Parameters
*
[in] Pointer to cache line.
Return Value
None.
Remarks
This function might do nothing if the requested functionality is not available on the target hardware platform.
Requirements
Routine Required header Architecture
_CacheWriteBack <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_ICacheRefresh
_ICacheRefresh
This function releases the cache line containing the address referenced by the pointer from the instruction cache.
Parameters
*
[in] Pointer to cache line.
Return Value
None.
Remarks
The extent of the instruction cache refreshed is implementation-dependent. It is usually at least 16 bytes, but can be the entire
instruction cache. In addition, prefetch of the instructions referenced by the pointer is implementation-dependent.
This function is not supported for SH and MIPS microprocessors.
Requirements
Routine Required header Architecture
_ICacheRefresh <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_ReadWriteBarrier, _WriteBarrier
_ReadWriteBarrier, _WriteBarrier
_ReadWriteBarrier forces all previous memory accesses to complete before subsequent memory access is started.
_WriteBarrier forces all previous memory write operations to complete before any subsequent write operation is started.
Parameters
None.
Return Value
None.
Remarks
_WriteBarrier is usually used for writing device drivers to make sure that a set of commands has been sent to the device
before further commands are issued. The compiler does not reschedule memory writes across an invocation of _WriteBarrier,
even on hardware platforms without explicit synchronization instructions.
_ReadWriteBarrier is usually used for writing device drivers to make sure that commands have been sent to the device before
status is read.
The compiler does not reschedule memory reads and writes across an invocation of _ReadWriteBarrier, even on hardware
platforms without explicit synchronization instructions.
Requirements
Routine Required header Architecture
_WriteBarrier <cmnintrin.h> x86, ARM, SH-4, MIPS
_ReturnAddress
_ReturnAddress
This function provides the return address of the instruction in the calling function that will be executed after control returns to
the caller.
void _ReturnAddress(void);
Parameters
None.
Return Value
None.
Remarks
Build the program in the Example section, and step through it in the debugger.
As you step through the program, note the address that is returned from _ReturnAddress.
Then, immediately after returning from the function where _ReturnAddress was used, open the Disassembly window and
note that the address of the next instruction to be executed matches the address returned from _ReturnAddress.
Optimizations such as inlining can affect the return address.
For example, if the following sample program is compiled with /Ob (Inline Function Expansion) with n=1, inline_func is
inlined into the calling function, main. Therefore, the calls to _ReturnAddress from inline_func and main each produce the
same value.
Example
// compiler_intrinsics__ReturnAddress.cpp
#include <stdio.h>
// _ReturnAddress should be prototyped before use
#ifdef __cplusplus
extern "C"
#endif
void * _ReturnAddress(void);
#pragma intrinsic(_ReturnAddress)
__declspec(noinline)
void noinline_func(void)
{
printf("Return address from %s: %p\n", __FUNCTION__, _ReturnAddress());
}
__forceinline
void inline_func(void)
{
printf("Return address from %s: %p\n", __FUNCTION__, _ReturnAddress());
}
int main(void)
{
noinline_func();
inline_func();
printf("Return address from %s: %p\n", __FUNCTION__, _ReturnAddress());
return 0;
}
Requirements
Routine Required header Architecture
_ReturnAddress <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CopyDoubleFromInt64
_CopyDoubleFromInt64
This function copies a floating-point double long integer into a long integer register.
double _CopyInt64FromDouble(
__int64 arg1
);
Parameters
arg1
[in] The long integer argument that the function acts on.
Return Values
The floating-point double result of converting arg1.
Remarks
This function can be implemented by copying the source value using a temporary memory location.
Requirements
Routine Required header Architecture
_CopyDoubleFromInt64 <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CopyFloatFromInt32
_CopyFloatFromInt32
This function copies an integer value to a floating-point register.
float _CopyFloatFromInt32(
___int32 arg1
);
Parameters
arg1
[in] The integer value acted upon by the function.
Return Values
The floating point conversion of arg1.
Remarks
This function can be implemented by copying the source value using a temporary memory location.
Requirements
Routine Required header Architecture
_CopyFloatFromInt32 <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CopyInt32FromFloat
_CopyInt32FromFloat
This function copies a floating-point number into an integer register.
__int32 _CopyInt32FromFloat(
float arg1
);
Parameters
arg1
[in] The floating-point value acted upon by the function.
Return Values
The integer conversion of arg1.
Remarks
This function can be implemented by copying the source value using a temporary memory location.
Requirements
Routine Required header Architecture
_CopyInt32FromFloat <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CopyInt64FromDouble
_CopyInt64FromDouble
This function copies a floating-point double to a long integer register.
__int64 _CopyInt64FromDouble(
double arg1
);
Parameters
arg1
[in] The floating-point double argument acted on by the function.
Return Values
The long integer result of the conversion.
Remarks
This function can be implemented by copying the source value using a temporary memory location.
Requirements
Routine Required header Architecture
_CopyInt64FromDouble <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_CountLeadingOnes, _CountLeadingOnes64
_CountLeadingOnes, _CountLeadingOnes64
This function returns the number of contiguous one bits starting with the most significant bit.
Parameters
arg1
[in] The long integer argument that the function examines to find one bits.
Return Values
The number of contiguous one bits in arg1. If all bits in arg1 are set, the return value of _CountLeadingOnes is 32, or the
value of _CountLeadingOnes64 is 64..
Remarks
This function can be implemented by calling a runtime function.
Requirements
Routine Required header Architecture
_CountLeadingOnes <cmnintrin.h> x86, ARM, SH-4, MIPS
_CountLeadingSigns, _CountLeadingSigns64
_CountLeadingSigns, _CountLeadingSigns64
This function returns the number of contiguous bits that match the sign bit, starting with the next most significant bit.
Parameters
arg1
[in] The unsigned integer value that the function operates on.
Return Values
The number of contiguous bits in arg1 that match the sign bit.
Remarks
This function can be implemented by calling a runtime function.
Requirements
Routine Required header Architecture
_CountLeadingSigns <cmnintrin.h> x86, ARM, SH-4, MIPS
_CountLeadingZeros, _CountLeadingZeros64
_CountLeadingZeros, _CountLeadingZeros64
This function returns the number of contiguous zero bits starting with the most significant bit in the argument.
Parameters
arg1
[in] The unsigned integer to be examined by the function.
Return Values
The number of contiguous zero bits in arg1. If none of the bits in arg1 are set, the return value is of _CountLeadingZeros is
32, or the value of _CountLeadingZeros64 is 64.
Remarks
This function can be implemented by calling a runtime function.
Requirements
Routine Required header Architecture
_CountLeadingZeros <cmnintrin.h> x86, ARM, SH-4, MIPS
_CountOneBits, _CountOneBits64
_CountOneBits, _CountOneBits64
This function returns the number of one bits in the argument.
Parameters
arg1
[in] The long integer value that the function examines for one bits.
Return Values
The number of one bits.
Remarks
This function can be implemented by calling a runtime function.
Requirements
Routine Required header Architecture
_CountOneBits <cmnintrin.h> x86, ARM, SH-4, MIPS
_isunordered, _isunorderedf
_isunordered, _isunorderedf
_isunordered compares two double precision numbers to determine if they are unordered.
_isunorderedf compares two floating-point numbers to determine if they are unordered.
Parameters
arg1
[in] The value to be compared to arg2.
arg2
[in] The value to be compared to arg1.
Return Values
Returns a Boolean value.
TRUE indicates that arg1 and arg2 are unordered.
Remarks
IEEE-754 floating-point comparison can have four separate result values: less-than, equal-to, greater-than or unordered.
The first three conditions can be tested using normal C operators, and this function is used to test for the last condition.
Two values are unordered if either is a NaN. This means that a NaN is not equal to any value, even itself.
The C++ compiler returns a bool value instead of an int.
Requirements
Routine Required header Architecture
_isunordered <cmnintrin.h> x86, ARM, SH-4, MIPS
MulDiv
MulDiv
The MulDiv function multiplies two 32-bit values and then divides the 64-bit result by a third 32-bit value. The return value is
rounded up or down to the nearest integer.
int MulDiv(
int nNumber,
int nNumerator,
int nDenominator
);
Parameters
nNumber
[in] Multiplicand.
nNumerator
[in] Multiplier.
nDenominator
[in] Number by which the result of the multiplication (nNumber * nNumerator) is to be divided.
Return Values
If the function succeeds, the return value is the result of the multiplication and division. If either an overflow occurred or
nDenominator was 0, the return value is –1.
Requirements
Routine Required header Architecture
MulDiv <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_MulHigh, _MulUnsignedHigh
_MulHigh, _MulUnsignedHigh
This function returns the high-order 32-bit result of multiplying two arguments.
Parameters
arg1
[in] The first argument in the product.
arg2
[in] The second argument in the product.
Return Values
The long integer result of multiplying arg1 and arg2.
Remarks
This function can be useful for detecting overflow. _MulHigh is useful for multiplying integers scaled to represent [-0.5..0.5),
and _MulUnsignedHigh is useful for multiplying integers scaled to represent 0..1).
Requirements
Routine Required header Architecture
_MulHigh <cmnintrin.h> x86, ARM, SH-4, MIPS
__assume
__assume
The __assume intrinsic function passes a hint to the optimizer.
__assume(expression)
Parameters
expression
Condition to be tested.
Return Value
None.
Remarks
The optimizer assumes that the condition represented by expression is true at the point where the keyword appears and
remains true until expression is altered (for example, by assignment to a variable). Selective use of hints passed to the
optimizer by __assume can improve optimization.
Example
//
// A common use of __assume tests the default case of a switch statement.
//
#ifdef DEGUG
# define ASSERT(e) ( ((e) || assert(__FILE__, __LINE__) )
#else
# define ASSERT(e) ( __assume(e) )
#endif
void gloo(int p)
{
switch(p){
case 1:
blah(1);
break;
case 2:
blah(-1);
break;
default:
__assume(0);
// This tells the optimizer that the default
// cannot be reached. Hence, no extra code
// is generated to check that 'p' has a value
// not represented by a case arm. This makes the switch
// run faster.
}
}
Requirements
Routine Required header Architecture
__assume <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
__noop
__noop
__noop gives you a function name to use when you want the function to be ignored and the argument list unevaluated.
__noop(functionname)
Parameters
Functionname
Name of function to be ignored
Return Value
None.
Example
// The following code shows how you could use __noop
// compile with or without /DDEBUG
#include <stdio.h>
#if DEBUG
#define PRINT printf
#else
#define PRINT __noop
#endif
void main() {
PRINT("\nhello\n");
}
Requirements
Routine Required header Architecture
__noop <cmnintrin.h> x86, ARM, SH-4, MIPS
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
strlen, strlen_l, wcslen, wcslen_l, _mbslen, _mbslen_l, _mbstrlen, _mbstrlen_l _strset, _wcsset, _mbsset, _mbsset_l
Intrinsic Forms of Math Library Functions
The following table lists intrinsic forms of math library functions that are supported by device compilers:
ceil, ceilf cos, cosf, cosh, coshf fmod, fmodf exp, log, and log
__break __cpuid
__dsrlz __faststorefence
__fc __fci
__fclrf __flushrs
__fsetc __fwb
__getPSP __getReg
__inbyte __inbytestring
__indword __indwordstring
__int2c __invalat
__isNat __isrlz
__mulh __outbyte
__outbytestring __outword
__rdteb __rdtsc
__readpmc __rsm
__rum __segmentlimit
__setReg __shiftleft128
__shiftright128 __ssm
__sum __synci
__writemsr __yield
_AcquireSpinLock _AddressOfReturnAddress
_InterlockedAdd _InterlockedAddLargeStatistic
_InterlockedCompareExchange16 _InterlockedCompareExchange64
_InterlockedDecrement16 _InterlockedExchangePointer
_InterlockedIncrement16 _InterlockedOr
_InterlockedXor _ReadBarrier
_ReleaseSpinLock _thash
_ttag _umul128
_umulh _wbinvd
The following table lists intrinsic forms of math library functions that are not supported by device compilers:
_INTRINSIC_IS_INLINE This macro tests to determine if the compiler can expand a specified intrinsic to one or more lines.
_INTRINSIC_IS_SAFE This macro determines if a specified intrinsic function is instantiated independent of the OS.
_INTRINSIC_IS_HELPER
_INTRINSIC_IS_HELPER
This macro determines if a specified intrinsic function is supported.
_INTRINSIC_IS_SUPPORTED(arg)
Parameters
Arg
The name of the intrinsic function of interest.
Return Value
A nonzero return value indicates that the specified intrinsic is supported by the compiler.
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_INTRINSIC_IS_INLINE
_INTRINSIC_IS_INLINE
This macro determines if a specified intrinsic function is supported.
_INTRINSIC_IS_SUPPORTED(arg)
Parameters
Arg
[in] The name of the intrinsic function of interest.
Return Value
A nonzero return value indicates that the specified intrinsic is supported by the compiler.
Example
// The followig example shows how to use the _INTRINSIC_IS_INLINE macro to determine if
the _rotl intrinsic will be expanded inline.
//
#include <cmnintrin.h>
#if _INTRINSIC_IS_INLINE(_rotl)
x = _rotl(y, 3);
#else
x = MY_ROTL(y, 3); // call my inline implementation, not the CRT helper
#endif
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_INTRINSIC_IS_SAFE
_INTRINSIC_IS_SAFE
This macro determines if a specified intrinsic function is instantiated independent of the OS.
_INTRINSIC_IS_SAFE(arg)
Parameters
Arg
[in] The name of the intrinsic function of interest.
Return Value
A nonzero return value indicates that the specified intrinsic does require invocation of an OS feature.
Remarks
An intrinsic function expansion sometimes requires the compiler to invoke an operating system feature because the compiler
itself cannot perform the particular task. Because the compiler cannot control whether the OS provides the required feature,
such an intrinsic is considered unsafe.
For example, the __trap intrinsic assumes that an OS handler is available to take an action. The compiler cannot guarantee that
such a handler is present, so the __trap intrinsic is considered unsafe.
See Also
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_INTRINSIC_IS_SUPPORTED
_INTRINSIC_IS_SUPPORTED
This macro determines if an intrinsic function is instantiated through a call to the Microsoft C Run-Time Library (CRT).
_INTRINSIC_IS_HELPER(arg)
Parameters
Arg
[in] The name of the intrinsic function of interest.
Return Value
A nonzero return value indicates that intrinsic named by arg is instantiated with a call to the CRT.
Example
//
// The following example shows how to use the
// _INTRINSIC_IS_SUPPORTED macro to determine
// support for the __trap intrinsic function.
//
#include <cmnintrin.h>
#if INTRINSIC_IS_SUPPORTED(__trap)
__trap(1); // __trap IS SUPPORTED
#else
// __trap IS NOT SUPPORTED
#endif
//
See Also
Reference
Common Intrinsic Functions for Device Compilers
Smart Device Development
Pre-defined Macros
Pre-defined Macros
The device compilers recognize seven predefined ANSI C macros and the Microsoft C++ implementation provides several
more.
These macros take no arguments and cannot be redefined. Their value, except for __LINE__ and __FILE__, must be constant
throughout compilation.
The following table provides additional information about predefined macros, some of which are defined with multiple values.
Macro Description
__DATE_ The compilation date of the current source file.
_
The date is a string literal of the form Mmm dd yyyy.
__FILE__ The name of the current source file. __FILE__ expands to a string surrounded by double quotation marks.
__FUNC Valid only within a function and returns the undecorated name of the enclosing function (as a string).
TION__
__FUNCTION__ is not expanded if you use /EP (Preprocess to stdout Without #line Directives) or /P (Preproce
ss to a File) compiler options.
__TIME_ The most recent compilation time of the current source file.
_
The time is a string literal of the form hh:mm:ss.
__TIMES The date and time of the last modification of the current source file, expressed as a string literal in the form Ddd Mm
TAMP__ m Date hh:mm:ss yyyy, where Ddd is the abbreviated day of the week and Date is an integer from 1 to 31.
Microsoft-specific Macros
The following table shows additional predefined macros that are Microsoft-specific.
_CHAR_UNSIGNED
Default char type is unsigned. Defined when /J (Default char Type Is unsigned) is specified.
__cplusplus
Defined for C++ programs only.
_CPPRTTI
Defined for code compiled with /GR (Enable Run-Time Type Information).
_CPPUNWIND
Defined for code compiled with /GX (Enable Exception Handling).
_MFC_VER
Defines the MFC version. Defined as 0x0600 for Microsoft Foundation Class Library 6.0 or later. Always defined.
_MSC_EXTENSIONS
This macro is defined when compiling with the /Za, /Ze (Disable Language Extensions) compiler option (the default). Its
value, when defined, is 1.
_MSC_VER
Defines the compiler version. Defined as 1200 for Microsoft Visual C++ 6.0 or later. Always defined.
_WIN32
Defined for applications for Win32. Always defined.
See Also
Other Resources
Differences Between Desktop and Device Compilers
Smart Device Development
struct x_
{
char a; // 1 byte
int b; // 4 bytes
short c; // 2 bytes
char d; // 1 byte
} MyStruct;
adr
offset element
------ -------
0x0000 char a; // bar[0]
0x0001 char pad0[3];
0x0004 int b;
0x0008 short c;
0x000a char d;
0x000b char _pad1[1];
See Also
Reference
__unaligned keyword
Concepts
Working with Packing Structures
Smart Device Development
char a[10];
char *p = &a[1];
long l = *(long *)p; // ERROR!; Attempt to move a long from
// the address of a char.
The following code example illustrates the correct and incorrect use of __unaligned and #pragma pack in conjunction with
integer operations. In the first section, a fault is generated because the __unaligned qualifier is not used, whereas in the
second section, the __unaligned qualifier is used correctly.
The output from this example appears in the following machine code example. In the output, function f_improper shows the
code generated by the improper handling of unaligned data, and function g_proper shows the extra code generated when
__unaligned is used.
In function g_proper, more than double the number of instructions are generated to handle the unaligned data, but an
alignment fault cannot occur.
f_improper::
mov r3, #0x17
str r0, [r0] // This instruction gets an alignment fault.
mov pc, lr
g_proper::
mov r3, #0x2A
strb r3, [r0] // Four individual bytes are stored,
mov r3, #0 // avoiding an alignment fault.
strb r3, [r0, #1]
strb r3, [r0, #2]
strb r3, [r0, #2]
mov pc, lr
Because there is a performance penalty for accessing data through an __unaligned pointer, use the __unaligned keyword
only when needed.
To guarantee that there are no alignment errors, the compiler must access the de-referenced data as a series of smaller pieces.
If the data is already aligned, this technique for accessing data is not necessary.
Alignment of Complex Types
The following list summarizes the rules for alignment of complex types:
The alignment of an array is the same as the alignment of the base type.
The alignment of a structure or object is the maximum of the alignment factors of all members of the structure. Further,
as long as structure packing is turned off, the compiler pads the structure so each member is placed at the next available
properly aligned address for that member.
The alignment of a union is also the maximum of the alignment factors of all members. Each member's address is that of the
union itself, so there is no padding.
See Also
Reference
__unaligned keyword
Concepts
Working with Packing Structures
Smart Device Development
If you reorganize the members of this structure, as shown in the following code example, the reorganized structure aligns
all members on natural boundaries, and the size of the structure is eight bytes instead of 12.
struct x_
{
int b; // 4 bytes
short c; // 2 bytes
char d; // 1 byte
char a; // 1 byte
} MyStruct;
void bar()
{
struct x_ __unaligned *px = &MyStruct;
. . . .
px->b = 5;
}
The __unaligned keyword should only be used as a last resort, because the generated code is less efficient than accessing
naturally aligned data. However, the __unaligned keyword is clearly preferable to alignment faults.
If at all possible, arrange the members of a data structure to preserve alignment and minimize space at the same time.
See Also
Reference
__unaligned keyword
Smart Device Development
__unaligned keyword
__unaligned keyword
The __unaligned keyword is a type modifier in pointer definitions. It indicates to the compiler that the data pointed to might
not be properly aligned on a correct address.
To be properly aligned, the address of an object must be a multiple of the size of the type. For example, two-byte objects must
be aligned on even addresses.
When data is accessed through a pointer declared __unaligned, the compiler generates the additional code necessary to load
or store, or read or write the data without causing alignment errors.
It is best to avoid using unaligned data, but in some cases the usage can be justified by the need to access packed structures
such as shared disk structures or I/O hardware.
Note: UNALIGNED is a Win32 macro that expands to __unaligned on hardware platforms that require it. UNALIGNED
expands to nothing on platforms that do not require __unaligned.
For portability, use UNALIGNED instead of the __unaligned keyword. When you use the UNALIGNED macro, include the
windef.h header, as in the following example:
#include <windef.h>
int UNALIGNED *p1; // p1 is a pointer to unaligned int
struct {int i;} UNALIGNED *p2; // p2 is a pointer to unaligned struct
See Also
Concepts
Working with Packing Structures
Smart Device Development
Provides guidelines and examples for creating prolog and epilog code sequences for Renesas microprocessor compilers.
MIPS Prolog and Epilog
Provides guidelines and examples for creating prolog and epilog code sequences for MIPS microprocessor compilers.
Smart Device Development
Prolog
Prolog
A prolog has several immediately contiguous parts, with no intervening instructions.
Typically, a prolog segment contains separate sequences of instructions that perform the following tasks:
Allocate a stack frame.
Save incoming argument registers.
Set up the frame pointer, if one is to be established. The prolog copies the stack pointer to a designated register before
the initial register saves; then it uses this value to compute the value of the frame pointer.
Save the link register with return address.
Allocate space for compiler-generated temporaries, local variables, and an argument build area.
Indicate the end of the prolog code.
Be sure your prolog code is succinct and only performs the necessary operations.
See Also
Reference
Prolog-Epilog Example
Concepts
SEH in RISC Environments
Smart Device Development
Epilog
Epilog
Although each procedure has only one prolog, a procedure can contain many epilogs if the procedure uses multiple exit points.
Each epilog is required to have certain specific parts. All parts are contiguous, with no intervening instructions.
Typically, an epilog segment contains separate sequences of instructions that perform the following tasks:
Restore the frame pointer register, if it was saved in the prolog
Restore nonvolatile registers, including the Program Counter and the stack
Restore the return address
Deallocate the local frame
Return to the calling function
See Also
Reference
Prolog-Epilog Example
Concepts
SEH in RISC Environments
Smart Device Development
Prolog-Epilog Example
Prolog-Epilog Example
The following code example allocates a stack frame that requires 64 KB of memory for an SH-4 microprocessor. The code
segment for an ARM or MIPS microprocessor is similar, except for the names of registers used.
The prolog segment in this example saves the argument register to the incoming argument save areas. No separate frame
pointer is required. The segment then saves the return address, saves the permanent register, and allocates the stack frame. It
declares an exception handler.
The epilog segment removes the stack frame and recovers the return address.
EXCEPTION_HANDLER RoutineHandler
NESTED_ENTRY Function
// Step 1.
//
mov.l R4, @R15 // Save argument to incoming argument save area.
mov.l R8, @-R15
sts.l PR, @-R15
mov.l @(0x0000001C,pc),r1 // Load constant -65528.
add r1,r15 // Allocate stack frame.
mov.l R5, R8 // Save argument to register.
PROLOG_END
// Routine body
ENTRY_END Function
Smart Device Development
Virtual Unwinding
Virtual Unwinding
To reconstruct the context that existed on entry to a routine, SEH for RISC processors uses a process called Virtual Unwinding
to emulate a small subset of instructions in prolog and epilog code.
Virtual unwinding provides a syntactically efficient way of transferring control from the kernel exception handler to user-mode
code.
In virtual unwinding, the kernel traverses the call stack to find an appropriate exception handler.
Starting with a CPU context record and an instruction address, the unwinding process interprets instructions in the prolog or
epilog to reconstruct the context, as it existed before the function call.
Code elements for unwinding
The Virtual Unwinder uses a PDATA Structures to determine the procedure start, the procedure end, and the prolog end. The
PDATA structure can also contain a pointer to an exception handler.
The subset of prolog and epilog code that the Virtual Unwinder emulates includes the following:
Adding or subtracting a value from a register
Loading or storing a register on the stack frame
Loading integer constants into registers
Moving between registers
The Virtual Unwinder ignores other instructions found in the prolog or epilog sequences.
Virtual Unwinder process
The following list shows the steps the Virtual Unwinder performs:
1. Search the prolog for an instruction that saves the frame pointer, the stack pointer, or the link register.
If the instruction is present, the instruction saves all permanent registers the Virtual Unwinder must restore.
If the instruction is not present, the link register contains the return address, and the Virtual Unwinder updates only the
program counter.
2. Search for an instruction in the prolog that writes the frame pointer. The unwinding process restores all registers from
this address down, starting from the lowest numbered register to the highest numbered register.
3. Search for an instruction that writes the stack. If such an instruction exists, the unwinding process must reverse-execute
the stack link. The right operand to this subtract is the stack size, which is a constant immediate value.
4. If execution stops inside a prolog, the Virtual Unwinder determines if an instruction that saves the permanent registers
executed, and if a stack link executed.
If the function has not saved the permanent registers, the Virtual Unwinder copies the value in the link register to
the program counter register.
If the function saved the register values, and if no stack link executed, the Virtual Unwinder updates the
permanent registers from the stack pointer.
If execution stopped in a prolog with a linked stack, the Virtual Unwinder reverse-executes the prolog.
Note:
All functions that move the stack pointer must have an associated PDATA structure for SEH to work. These include any functi
on that allocates stack space, calls other functions, saves permanent registers, or has an exception handler. A leaf function (th
at is, a function that calls no other functions) that does not modify a permanent register does not need PDATA. In this case, th
e Virtual Unwinder updates the program counter from the link register and continues to the next frame.
See Also
Reference
Prolog-Epilog Example
PDATA Structures
Concepts
SEH in RISC Environments
Smart Device Development
PDATA Structures
PDATA Structures
ARM, MIPS, and SHx device compilers use PDATA structures to aid in stack walking at run-time. This structure aids in
debugging and exception processing.
The compilers associate one PDATA structure with each procedure.
The data structure is a table stored in a COFF .pdata section. The .pdata section contains an array of function table entries for
exception handling, and is pointed to by the exception table entry in the image data directory.
The MIPS calling standard supports an uncompressed PDATA format, _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY. In most
cases, MIPSII currently uses an uncompressed 20 bytes for each function for the _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
entry.
Leaf functions that do not have associated exception-handling routines do not have an associated pdata entry.
The following table shows the function table entry format for MIPSII images.
Offset Size Field Description
0 4 Begin Address Virtual address of the corresponding function.
16 4 Prolog End Address Virtual address of the end of the function prolog.
ARM and SH-4 Device compilers support a compressed PDATA structure, _IMAGE_CE_RUNTIME_FUNCTION_ENTRY.
The following table shows the COFF-specified function-table entry format used for the ARM and SH-4 hardware platforms.
Offset Size Field Description
0 4 Begin Address Virtual address of the corresponding function.
4 1 bit 32-bit Flag Set if the function is comprised of 32-bit instructions, cleared for a 16-bit function.
4 1 bit Exception Flag Set if an exception handler exists for the function.
If an exception handler exists or the function length is zero, an additional PDATA_EH structure precedes the function in the .text
section. The function uses PDATA_EH when the function has an associated exception handler or handler data.
In most cases, PDATA structure occupies only eight bytes per function. For functions that have an exception handler, the
PDATA_EHstructure requires an additional eight bytes.
The exception-handling data record and the prolog and function length record are guaranteed to be 4-byte aligned. This
implies that any function associated with one or more of these records is 4-byte aligned.
See Also
Concepts
Virtual Unwinding
Smart Device Development
_IMAGE_CE_RUNTIME_FUNCTION_ENTRY
_IMAGE_CE_RUNTIME_FUNCTION_ENTRY
This structure contains detailed information about runtime exception processing.
_IMAGE_CE_RUNTIME_FUNCTION_ENTRY is used only by ARM and Renesas microprocessor families. It does not apply to
MIPS microprocessors.
Parameters
FuncStart
Address of the first instruction in the function. It is the function's entry address.
PrologLen
Length of the prolog in instructions, based on the instruction size indicated in the ThirtyTwoBit flag. PrologLen is set to 1 for
ARM functions, and to 0 for THUMB and SH-4 functions.
FuncLen
Total function length in instructions; see PrologLen, above. A function with 200 ARM instructions would have a FuncLen of
200, or 800 bytes.
ThirtyTwoBit
Size of instructions in a function. ThirtyTwoBit can hold one of the following values: 1Represents ARM functions, each of
which consists of 32-bit instructions, or 4 bytes. 0Represents THUMB functions, each of which consists of 16-bit instructions,
or 2 bytes.
ExceptionFlag
Associated exception handler or handler data. When its value is 1, the PDATA_EH is present in the .text section. When the
ExceptionFlag is 0, no PDATA_EH is present.
Remarks
The IMAGE_CE_RUNTIME_FUNCTION_ENTRY data structure is also called as PDATA. A table containing these records is
stored in a section called .pdata. The .pdata section aids in debugging and exception processing.
If the ExceptionFlag is set, or if the FuncLen is set to 0, an additional PDATA_EH structure exists that precedes the function in the
.text section.
The data record containing this information appears in the .text section, immediately preceding the function, if and only if the
ExceptionFlag bit is set.
This record is used when the function has an associated exception handler or handler data.
See Also
Reference
PDATA Structures
PDATA_EH
Smart Device Development
_IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
_IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
This structure contains detailed information about runtime exception processing.
This structure has an uncompressed 20-byte format.
Parameters
BeginAddress
Address of the first instruction in the function. It is the function's entry address.
EndAddress
Address of the last instruction in the function. It is the function's end address.
ExceptionHandler
Address of the exception handler for the function.
HandlerData
Address of the exception handler data record for the function.
PrologEndAddress
Address of the last instruction in the prolog.
See Also
Reference
PDATA Structures
Smart Device Development
PDATA_EH
PDATA_EH
This structure holds detailed information about an associated exception handler function. This is an internal data structure used
in OS exception processing.
Parameters
pHandler
Address of the exception handler for the function.
pHandlerData
Address of the exception handler data record for the function.
See Also
Reference
PDATA Structures
_IMAGE_CE_RUNTIME_FUNCTION_ENTRY
Smart Device Development
Compiler Error C2880 Indicates an attempt to create a namespace alias failed because the namespace already exists.
Compiler Error C2887 Indicates too many arguments for a __swi intrinsic.
Compiler Warning (level 1) C47 Indicates an intrinsic function not supported in the target architecture.
32
Compiler Warning (Level 1) C4 Indicates that the linker encountered incompatible object files from different versions of the c
567 ompiler.
See Also
Other Resources
Compilers for Smart Devices
Smart Device Development
This error indicates that the compiler attempted to compile an intrinsic function not supported in Thumb mode, such as
_prefetch.
Note that if source is compiled with the /GL (Whole Program Optimization) switch, this error will not be output until the
referenced object is linked.
Smart Device Development
The implementation of Structured Exception Handling on this platform does not support a local unwind operation, which is
required when prematurely leaving either the guarded section or the termination handler of a try-finally statement. If you
need to leave the guarded section, use the __leave keyword. Leaving the termination handler prematurely can have undefined
behavior and should be avoided.
The following code demonstrates two ways this error message can be generated.
int g;
int main(void)
{
__try {
if (g) return g; // requires local unwind
g = 1;
} __finally {
if (g) return g; // undefined; requires local unwind
g = 2;
}
return 0;
}
Smart Device Development
The _swi intrinsic function did not receive an integer constant as expected for the first argument. The integer constant must be
in the range [0 - 16777215] for ARM, or [0 - 255] for Thumb microprocessors.
Example
int test_intrinsic(int x)
{
This SH-specific warning applies to multiple situations that might occur for SH inline assembly.
This warning is not visible when compiling with the -GL Whole Program Optimization option.
In the following example code, the compiler issues this warning to indicate a branch in a delay slot.
Example
/* C4720.c */
#ifdef __cplusplus
extern "C" void __asm(const char *, ...);
#else
extern void __asm(const char *,...);
#endif
int main()
{
int ValA = 10;
int ValB = 0;
__asm(
"mov.l @r4, r2\n"
"mov #0, r6\n"
"add r2, r6\n"
"bf/s lala\n"
"bf la\n"
"lala: add r2, r6\n"
"la: mov.l r6, @r5\n",
&ValA,&ValB); /* delay slot branch */
return 0;
}
Smart Device Development
The compiler encountered an unknown intrinsic function. The use of #pragma intrinsic('function') will be ignored.
Smart Device Development
The compiler encountered an intrinsic function that is not supported in the target architecture.
The __trap intrinsic is not supported under the MIPS 16 ISA. As a result, the following code example causes the compiler to
generate compiler warning C4732.
Example
#include <cmnintrin.h>
int main()
{
int returnCode = 1;
#if (_INTRINSIC_IS_SUPPORTED(__trap))
__trap(1);
#else
return 1;
#endif
return 0;
}
Smart Device Development
This warning indicates that the compiler encountered code that may not execute correctly if it is linked with code compiled by
an earlier compiler version.
This warning is specific to the C++ compiler for the ARM(R) Architecture. Versions of the compiler older than 14.00 use a
different calling convention than newer compilers when passing certain function parameters by value. The two calling
conventions are not compatible, and linking object files from an older compiler with newer object files can result in
unpredictable behavior and crashes if such a parameter is passed by value between the old and new object files.
An object of class, struct, or union type with a user-defined copy constructor is subject to this calling convention change if it is
passed by value. Objects passed by reference are not affected.
If you are linking to object files from older compilers, use this warning to find places in your code where the calling convention
has changed. If objects with user-defined copy constructors are passed by value between old and new object files, the old
object files must be recompiled with a compiler version 14.00 or later.
This warning is off by default.
Example
// The following sample generates C4567:
// C4567.cpp
// (optional) compile with: -w14567
#pragma warning(default : 4567)
#pragma inline_depth(0) // disable function inlining
#include <cstdio>
struct S {
S () { self = this; }
S (S& that) { self = this; }
~S() { // older compilers will fail this test
if ( self != this ) {
printf ("s passed incorrectly\n");
}
}
S* self;
};
void func ( S s ) // C4567 at definition
{
// s destructor is called here
}
int main()
{
S s;
func (s); // C4567 at call site
return 0;
}
See Also
Other Resources
Differences Between Desktop and Device Compilers
Smart Device Development
_swi Generates a call to the OS using the SWI software interrupt instruction.
CLZ
CLZ
This ARM10 instruction counts the number of binary zero bits before the first binary one bit in a register value. The common
_CountLeadingZeros, _CountLeadingZeros64intrinsic supports CLZ.
Parameters
Arg1
[in] The value for which the leading zero bits should be determined.
Return Values
Number of binary zero bits.
Remarks
To generate the CLZ instruction for the _CountLeadingZeros intrinsic, use the -QRarch5 or -QRarch5T flag.
If you are compiling on an ARM4 microprocessor, the compiler generates a call to a library name, or to some other sequence
of ARM 4 code.
Requirements
Routine Required header Architecture
CLZ <armintr.h> ARM
See Also
Reference
ARM10 Intrinsic Functions
/QRArch - Specify Target Architecture
Other Resources
Common Intrinsic Function Reference
Smart Device Development
BKPT
BKPT
This ARM10 instruction causes a software breakpoint to occur. The common __trap intrinsic supports BKPT.
int __trap(
int Arg1
);
Parameters
Arg1
[in] Address of breakpointed instruction.
Return Values
None.
Requirements
Routine Required header Architecture
BKPT <armintr.h> ARM
See Also
Reference
ARM10 Intrinsic Functions
Other Resources
Common Intrinsic Function Reference
Smart Device Development
__emit
__emit
This intrinsic function inserts a specified instruction into the stream of instructions output by the compiler.
void __emit(
const unsigned __int32 opcode
);
Parameters
opcode
Instruction word to be inserted.
Return Values
None
Remarks
The value of opcode must be a constant expression known at compile time.
The compiler makes no attempt to interpret the contents of opcode and does not guarantee a CPU or memory state before the
inserted instruction is executed.
The compiler assumes that the CPU and memory states are unchanged after the inserted instruction is executed. Therefore,
instructions that do change state can have a detrimental impact on normal code generated by the compiler.
For this reason, use __emit only to insert instructions that affect a CPU state that the compiler does not normally process, such
as coprocessor state, or to implement functions declared with __declspec(naked).
When generating ARM instructions, the size of an instruction word is 32 bits. When generating Thumb instructions, as when
/QRthumb is specified, the size of an instruction word is 16 bits and the most significant 16 bits of opcode are ignored.
Requirements
Routine Required header Architecture
__emit <armintr.h> ARM
See Also
Reference
ARM10 Intrinsic Functions
/QRthumb
Smart Device Development
_MoveFromCoProcessor, _MoveFromCoProcessor2
_MoveFromCoProcessor, _MoveFromCoProcessor2
These intrinsic functions read data from ARM coprocessors via the coprocessor data transfer instructions.
int _MoveFromCoprocessor(
unsigned int coproc,
unsigned int opcode1,
unsigned int crn,
unsigned int crm,
unsigned int opcode2
);
int _MoveFromCoprocessor2(
unsigned int coproc,
unsigned int opcode1,
unsigned int crn,
unsigned int crm,
unsigned int opcode2
);
Parameters
coproc
Coprocessor number in the range 0 to 15.
opcode1
Coprocessor-specific opcode in the range 0 to 7.
crn
Coprocessor register number in the range 0 to 15, which specifies the first operand to the instruction.
crm
Coprocessor register number in the range 0 to 15, which specifies an additional source or destination operand.
opcode2
Additional coprocessor-specific opcode in the range 0 to 7.
Return Values
The value read from the coprocessor.
Remarks
The values of all five parameters to this intrinsic must be constant expressions known at compile time.
_MoveFromCoprocessor uses the MRC instruction; _MoveFromCoprocessor2 uses MRC2. The parameters correspond to
bitfields encoded directly into the instruction word. The interpretation of the parameters is coprocessor-dependent. For more
information, see the manual for the coprocessor in question.
These intrinsics are not available when generating Thumb instructions, such as when /QRthumb is specified.
Requirements
Routine Required header Architecture
_MoveFromCoprocessor <armintr.h> ARM
Routine Required header Architecture
_MoveFromCoprocessor2 <armintr.h> ARM
See Also
Reference
ARM10 Intrinsic Functions
/QRthumb
Smart Device Development
_MoveToCoProcessor, MoveToCoprocessor2
_MoveToCoProcessor, MoveToCoprocessor2
These intrinsic functions write data to ARM coprocessors via the coprocessor data transfer instructions.
Void _MoveToCoprocessor(
unsigned int value,
unsigned int coproc,
unsigned int opcode1,
unsigned int crn,
unsigned int crm,
unsigned int opcode2
);
Void _MoveToCoprocessor2(
unsigned int value,
unsigned int coproc,
unsigned int opcode1,
unsigned int crn,
unsigned int crm,
unsigned int opcode2
);
Parameters
value
Value to be written to the coprocessor.
coproc
Coprocessor number in the range 0 to 15.
opcode1
Coprocessor register number in the range 0 to 15, which specifies and additional source or destination operand.
opcode2
Additional coprocessor-specific opcode in the range 0 to 7.
Return Values
None
Remarks
The values of coproc, opcode1, crn, crm, and opcode2 must be constant expressions known at compile time.
_MoveToCoprocessor uses the MCR instruction; _MoveToCoprocessor2 uses MCR2.
The parameters correspond to bitfields encoded directly into the instruction word. The interpretation of the parameters is
coprocessor-dependent. For more information, see the manual for the coprocessor in question.
These intrinsics are not available when generating Thumb instructions, such as when /QRthumb is specified.
Requirements
Routine Required header Architecture
_MoveToCoprocessor , <armintr.h> ARM
_MoveToCoprocessor2
See Also
Reference
ARM10 Intrinsic Functions
/QRthumb
Smart Device Development
_swi
_swi
This intrinsic function generates a call to an OS routine using the software interrupt instruction SWI.
Parameters
swi_number
Software Interrupt number
arg2-arg4
Additional arguments for passing
Return Values
The _swi intrinsic function returns the value left in register R0 when control is returned to the instruction following the SWI.
Remarks
The _swi intrinsic applies to the ARM or the Thumb instruction set, depending on whether the compiler is generating 32-bit or
16-bit code.
The first parameter, swi_number, is encoded directly into the immediate field of the instruction. It must be an integer constant
in the range [0 - 16777215] for ARM or [0 - 255] for Thumb.
If additional arguments are included, the function passes the values according to the standard ARM calling convention with
one exception: no arguments or parts of arguments may be passed in memory, that is, on the stack.
Therefore, all arguments must be able to be passed using only registers R0, R1, R2, and R3.
Requirements
Routine Required header Architecture
_swi <armintr.h> ARM
See Also
Reference
/QRArch - Specify Target Architecture
/QRthumb
Smart Device Development
_SmulAddWLo_S SMLAWy A 32x16-bit multiply operation, followed by a 32-bit add of the upper 32 bits
W_SL of the 48 bit product.
_SmulAddWHi_S
W_SL
_SmulAddHi_SW SMLALxy A 16x16-bit multiply operation, followed by a 64-bit add of the product, with
_SQ a 64-bit integer.
_SmulAddLo_SW
_SQ
_SmulAddHiLo_S
W_SQ
_SmulAddLoHi_S
W_SQ
_SmulWLo_SW_S SMULWy A signed-integer 32x16-bit multiply operation, returning the upper 32-bits.
L
_SmulWHi_SW_S
L
_DAddSatInt QDADD An instruction to double an integer and saturate, and then add to a second int
eger and saturate.
_DSubSatInt QDSUB An instruction to double an integer and saturate, and then subtract from a sec
ond integer and saturate.
_ReadCoProcess MRRC, An operation to transfer values from a coprocessor to two ARM registers.
or
MCRR
_WriteCoProcess
or
See Also
Reference
ARM XSCALE Intrinsic Functions
Other Resources
Intrinsic Functions for Device Compilers
Smart Device Development
_SmulAddLo_SW_SL
_SmulAddLo_SW_SL
This ARM DSP-enhanced, signed-integer multiply-accumulate operation multiplies the bottom half of register Rm and the
bottom half of register Rs, producing a 32-bit product. The operation then performs a 32-bit accumulation with Rn.
int _SmulAddLo_SW_SL(
int Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
Contents of Rn, the value added to the product of Arg2 and Arg3.
Arg2
[in] The contents of Rm, the first term multiplied.
Arg3
[in] The contents of Rs, the second term multiplied.
Return Values
The result of multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlabb assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddLo_SW_SL <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddHi_SW_SL
_SmulAddHiLo_SW_SL
_SmulAddLoHi_SW_SL
Smart Device Development
_SmulAddHi_SW_SL
_SmulAddHi_SW_SL
This ARM DSP-enhanced, signed-integer multiply-accumulate operation multiplies the top half of register Rm and the top half
of register Rs, producing a 32-bit product. The operation then performs a 32-bit accumulation with Rn.
int _SmulAddHi_SW_SL(
int Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
The contents of Rn, the value added to the product of Arg2 and Arg3.
Arg2
[in] The contents of Rm, the first term multiplied.
Arg3
[in] The contents of Rs, the second term multiplied.
Return Values
The result of the multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlatt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddHi_SW_SL <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddLo_SW_SL
_SmulAddHiLo_SW_SL
_SmulAddLoHi_SW_SL
Smart Device Development
_SmulAddHiLo_SW_SL
_SmulAddHiLo_SW_SL
This ARM DSP-enhanced, signed-integer multiply-accumulate operation multiplies the top half of register Rm and the bottom
half of register Rs to produce a 32-bit product. The operation then performs a 32-bit accumulation with Rn.
int _SmulAddHiLo_SW_SL(
int Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
The contents of Rn, the value added to the product of Arg2 and Arg3.
Arg2
[in] The contents of Rm, the first term multiplied.
Arg3
[in] The contents of Rs, the second term multiplied.
Return Values
The result of multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlatb assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddHiLo_SW_SL <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddHi_SW_SL
_SmulAddLo_SW_SL
_SmulAddLoHi_SW_SL
Smart Device Development
_SmulAddLoHi_SW_SL
_SmulAddLoHi_SW_SL
This ARM DSP-enhanced, signed-integer multiply-accumulate operation multiplies the bottom half of register Rm and the top
half of register Rs, producing a 32-bit product. The operation then performs a 32-bit accumulation with Rn.
int _SmulAddLoHi_SW_SL(
int Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
The contents of Rn, the value added to the product of Arg2 and Arg3.
Arg2
[in] The contents of Rm, the first term multiplied.
Arg3
[in] The contents of Rs, the second term multiplied.
Return Values
The integer result of multiplication.
Remarks
The compiler translates this instruction into the smlabt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddLoHi_SW_SL <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddLo_SW_SL
_SmulAddHiLo_SW_SL
_SmulAddHi_SW_SL
Smart Device Development
_SmulAddWLo_SW_SL
_SmulAddWLo_SW_SL
This ARM DSP-enhanced, signed integer multiply-accumulate operation multiplies Rm with the bottom 16 bits of Rs; then it
accumulates in Rn. The operation adds the upper 32 bits of the 48-bit product to the 32-bit Rn.
int _SmulAddWLo_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the product.
Arg2
_SmulAddWHi_SW_SL
_SmulAddWHi_SW_SL
This ARM DSP-enhanced, signed integer multiply-accumulate operation multiplies Rm with the top 16 bits of Rs then
accumulates in Rn. The operation adds the upper 32 bits of the 48-bit product to the 32-bit Rn.
int _SmulAddWHi_SW_SL(
int Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
[in] The contents of Rn, the value added to the product of Arg2 and Arg3.
Arg2
[in] The contents of Rm, the first term in the product.
Arg3
[in] The contents of Rs, the second term in the product.
Return Values
The integer result of the multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlawt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddWHi_SW_SL <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddWLo_SW_SL
Smart Device Development
_SmulAddHi_SW_SQ
_SmulAddHi_SW_SQ
This ARM DSP-enhanced, signed integer multiply-accumulate operation first performs a multiply on two 16-bit source
operands from the top half of register Rm and the top half of Rs. This is followed with a 64 bit accumulate with the 32-bit
registers RdLo and RdHi.
__int64 _SmulAddHi_SW_SQ(
__int64 Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
Pointers to a 64-bit accumulate that contains RdHi and RdLo.
Arg2
[in] The contents of Rm, the first term in the product.
Arg3
[in] The contents of Rs, the second term in the product.
Return Values
The long integer result of the multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlaltt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddHi_SW_SQ <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddLo_SW_SQ
_SmulAddHiLo_SW_SQ
_SmulAddLoHi_SW_SQ
Smart Device Development
_SmulAddLo_SW_SQ
_SmulAddLo_SW_SQ
This ARM DSP-enhanced, signed integer multiply-accumulate operation first performs a multiply on two 16-bit source
operands from the bottom half of register Rm and the bottom half of Rs. This is followed with a 64 bit accumulate with the 32-
bit registers RdLo and RdHi.
__int64 _SmulAddLo_SW_SQ(
__int64 Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
A pointer to a 64-bit variable used to accumulate the contents of RdHi and RdLo.
Arg2
[in] The contents of Rm, the first term in the product.
Arg3
[in] The contents of Rs, the second term in the product.
Return Values
The result of multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlalbb assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddLo_SW_SQ <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddHi_SW_SQ
_SmulAddHiLo_SW_SQ
_SmulAddLoHi_SW_SQ
Smart Device Development
_SmulAddHiLo_SW_SQ
_SmulAddHiLo_SW_SQ
This ARM DSP-enhanced, signed integer multiply-accumulate operation multiplies the top half of register Rm and the bottom
half of Rs. This is followed with a 64 bit accumulate with the 32-bit registers RdLo and RdHi.
__int64 _SmulAddHiLo_SW_SQ(
__int64 Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
Pointer to a 64-bit variable used to accumulate the contents of RdHi and RdLo.
Arg2
[in] The contents of Rm, the first term in the product.
Arg3
[in] The contents of Rs, the second term in the product.
Return Values
The long integer result of multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlaltb assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddHiLo_SW_SQ <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddLo_SW_SQ
_SmulAddLoHi_SW_SQ
_SmulAddHi_SW_SQ
Smart Device Development
_SmulAddLoHi_SW_SQ
_SmulAddLoHi_SW_SQ
This ARM DSP-enhanced, signed integer multiply-accumulate operation multiplies the bottom half of register Rm and the top
half of Rs. This is followed with a 64 bit accumulate with the 32-bit registers RdLo and RdHi.
__int64 _SmulAddLoHi_SW_SQ(
__int64 Arg1,
int Arg2,
int Arg3
);
Parameters
Arg1
A pointer to a 64-bit variable used to accumulate the contents of RdHi and RdLo.
Arg2
[in] The contents of Rm, the first term in the product.
Arg3
[in] The contents of Rs, the second term in the product.
Return Values
The long integer result of the multiplication and accumulation.
Remarks
The compiler translates this instruction into the smlalbt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddLoHi_SW_SQ <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_SmulAddLo_SW_SQ
_SmulAddHiLo_SW_SQ
_SmulAddHi_SW_SQ
Smart Device Development
_SmulHi_SW_SL
_SmulHi_SW_SL
This ARM DSP-enhanced, signed integer multiply operation multiplies the top half of register Rm times the top half of register
Rs, producing a 32-bit result in Rd.
int _SmulHi_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the product.
Arg2
_SmulLo_SW_SL
_SmulLo_SW_SL
This ARM DSP-enhanced, signed integer multiply operation multiplies the bottom half of register Rm times the bottom half of
register Rs, producing a 32-bit result in Rd.
int _SmulLo_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the product.
Arg2
_SmulHiLo_SW_SL
_SmulHiLo_SW_SL
This ARM DSP-enhanced, signed integer multiply operation multiplies the top half of register Rm times the bottom half of
register Rs, producing a 32-bit result in Rd.
int _SmulHiLo_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the product.
Arg2
_SmulLoHi_SW_SL
_SmulLoHi_SW_SL
This ARM DSP-enhanced, signed integer multiply operation multiplies the bottom half of register Rm times the top half of
register Rs, producing a 32-bit result in Rd.
int _SmulLoHi_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the product.
Arg2
_SmulWHi_SW_SL
_SmulWHi_SW_SL
This ARM DSP-enhanced, signed-integer multiplication operation performs a 32x16 bit multiply on the 32-bit operand in Rm
and the 16-bit source operand from the top half of register Rs. It then takes the upper 32 bits of the 48-bit product.
int _SmulWHi_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The first term in the product, the contents of Rm.
Arg2
_SmulWLo_SW_SL
_SmulWLo_SW_SL
This ARM DSP-enhanced, signed-integer multiplication operation performs a 32x16 bit multiply on the 32-bit operand in Rm
and the 16-bit source operand from the bottom half of register Rs. It then takes the upper 32 bits of the 48-bit product.
int _SmulWLo_SW_SL(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the product.
Arg2
_AddSatInt
_AddSatInt
This ARM DSP-enhanced operation performs a saturating add instruction. It adds registers Rm and Rn, and places the result in
register Rd. It affects the sticky-overflow bit 'Q' if overflow occurs in the addition.
int _AddSatInt(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The contents of Rm, the first term in the sum.
Arg2
_DAddSatInt
_DAddSatInt
This operation calculates SAT(Rm + SAT(Rn*2)); that is, the operation first saturates the double of Rn, adds the result to Rm,
then saturates the sum.
int _DAddSatInt(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] This integer is added to the doubled Arg2. It is analogous to the value in Rm.
Arg2
[in] This integer is the term that is doubled. It is analogous to the value in Rn.
Return Values
The result of the binary arithmetic.
Remarks
The compiler translates this instruction into the qdadd assembly instruction.
Saturation can occur on the doubling operation, on the addition, or both. If saturation occurs on the doubling operation, but
not on the addition, the Q flag is set and the the final result is unsaturated.
Requirements
Routine Required header Architecture
_DAddSatInt <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
_DSubSatInt
Smart Device Development
_SubSatInt
_SubSatInt
This ARM DSP-enhanced operation performs a saturating subtract instruction. It subtracts the value in Rn from the value in
Rm, and places the result in register Rd. This operation affects the sticky-overflow bit 'Q' if overflow occurs in the subtraction.
int _SubSatInt(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The first term in the difference, the contents of Rm.
Arg2
_DSubSatInt
_DSubSatInt
This operation doubles Rn and saturates, then subtracts the result from Rm and saturates. This operation affects the sticky-
overflow bit 'Q' if overflow occurs in the subtraction.
int _DSubSatInt(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] The doubled Arg2 is subtracted from this integer. It is the contents of the value in Rm.
Arg2
_ReadCoProcessor
_ReadCoProcessor
This instruction causes the specified coprocessor registers to transfer values to two ARM registers.
__int64 _ReadCoProcessor(
int Arg1
);
Parameters
Arg1
[in] Coprocessor number, equivalent to cp_num.
Return Values
Value held in coprocessor register.
Remarks
The compiler translates this instruction into the MRRC assembly instruction for ARM DSP-enhanced processors, and into the
MRA assembly instruction for ARM XScale processors. MRA is disassembled as the MRCC instruction.
The XScale and the DSP-enhanced ARM microprocessors each implement this instruction in a different way:
For the ARM XScale implementation, this instruction does the following:
Moves 64 bits of data to ARM registers from Coprocessor registers
Moves the 40-bit accumulator value (acc0) into two registers
Moves bits [31:0] of the value in acc0 into the register RdLo
Sign-extends bits [39:32] of the value in acc0 to 32 bits and moves them into the register RdHi
For the ARM DSP-enhanced implementation, this instruction causes the coprocessor to transfer values to the two
general-purpose registers Rd and Rn.
Requirements
Routine Required header Architecture
_ReadCoProcessor <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
ARM XSCALE Intrinsic Functions
_WriteCoProcessor
Smart Device Development
_WriteCoProcessor
_WriteCoProcessor
This instruction causes the specified ARM registers to transfer values to coprocessor registers.
void _WriteCoProcessor(
__int64 Arg1,
int Arg2
);
Parameters
Arg1
[in] Values to be written to coprocessor.
Arg2
[in] Coprocessor number. This should be zero.
Return Values
None.
Remarks
For the ARM XScale processor, the compiler translates this intrinsic into the MAR assembly instruction. MAR is disassembled
as the MCRR instruction.
For the ARM DSP-enhanced processor, the compiler translates this intrinsic into the MCRR assembly instruction.
The XScale and the DSP-enhanced ARM microprocessors implement this instruction in two slightly different ways.
ARM XScale implementation
This instruction moves the value in register RdLo to bits [31:0] of the 40-bit accumulator (acc0), and moves bits [7:0] of
the value in register RdHi into bits [39:32] of acc0.
ARM DSP-enhanced implementation
This instruction causes the two general-purpose registers Rd and Rn to transfer values to the coprocessor.
Requirements
Routine Required header Architecture
_WriteCoProcessor <armintr.h> ARM10, ARM-DSP
See Also
Reference
ARM XSCALE Intrinsic Functions
ARM DSP-enhanced Intrinsic Functions
_ReadCoProcessor
Smart Device Development
_SmulAddPack_2 MIAPH Performs two 16x16 signed multiplications on packed half-word data and accumulates th
SW_ACC ese to a single 40-bit accumulator.
_SmulAddLo_SW MIAxy Performs one 16-bit signed multiplication and accumulates the result to a single 40-bit ac
_ACC cumulator.
_SmulAddHi_SW_
ACC
_SmulAddLoHi_S
W_ACC
_SmulAddHiLo_S
W_ACC
_ReadCoProcesso MAR Moves 64 bits of data from ARM registers to coprocessor registers.
r
_WriteCoProcess MRA Moves 64 bits of data to ARM registers from coprocessor registers.
or
_PreLoad PLD This instruction is used as a hint to the memory system that a memory access from the sp
ecified address will occur shortly.
See Also
Reference
ARM10 Intrinsic Functions
ARM XSCALE Intrinsic Functions
Smart Device Development
_PreLoad
_PreLoad
This instruction is a soft preload instruction; that is, this instruction indicates to the memory system that a memory access from
the specified address will occur shortly.
void _PreLoad(
unsigned long* addr
);
Parameters
addr
Location of memory access.
Return Values
None.
Remarks
The compiler translates this instruction into the PLD assembly instruction.
Requirements
Routine Required header Architecture
_PreLoad <armintr.h> ARM10, ARM-DSP, ARM XSCALE
See Also
Reference
ARM XSCALE Intrinsic Functions
Smart Device Development
_SmulAdd_SL_ACC
_SmulAdd_SL_ACC
This operation multiplies the signed value in register Rs by the signed value in register Rm and then adds the result to the 40-
bit accumulator, acc0.
void _SmulAdd_SL_ACC(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] Values in Rs to be written to coprocessor.
Arg2
_SmulAddHi_SW_ACC
_SmulAddHi_SW_ACC
This instruction multiplies the top half of Rm and the top half of Rs and accumulates the result to a single 40-bit accumulator.
The instruction does not support unsigned multiplication, but interprets all arguments as signed data values.
void _SmulAddHi_SW_ACC(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] Value in Rm.
Arg2
[in] Value in Rs.
Return Values
None.
Remarks
The compiler translates this instruction into the miatt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddHi_SW_ACC <armintr.h> ARM10, ARM-DSP, ARM XSCALE
See Also
Reference
ARM XSCALE Intrinsic Functions
_SmulAddLo_SW_ACC
_SmulAddHiLo_SW_ACC
_SmulAddLoHi_SW_ACC
Smart Device Development
_SmulAddHiLo_SW_ACC
_SmulAddHiLo_SW_ACC
This ARM XScale instruction multiplies the top half of Rm and the bottom half of Rs and accumulates the result to a single 40-
bit accumulator.
The instruction does not support unsigned multiplication, but interprets all arguments as signed data values.
void _SmulAddHiLo_SW_ACC(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] Value in Rm.
Arg2
[in] Value in Rs.
Return Values
None.
Remarks
The compiler translates this instruction into the miatb assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddHiLo_SW_ACC <armintr.h> ARM10, ARM-DSP, ARM XSCALE
See Also
Reference
ARM XSCALE Intrinsic Functions
_SmulAddLo_SW_ACC
_SmulAddHi_SW_ACC
_SmulAddLoHi_SW_ACC
Smart Device Development
_SmulAddLo_SW_ACC
_SmulAddLo_SW_ACC
This ARM XScale instruction multiplies the bottom half of Rm and the bottom half of Rs and accumulates the result to a single
40-bit accumulator.
The instruction does not support unsigned multiplication, but interprets all arguments as signed data values.
void _SmulAddLo_SW_ACC(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] Value in Rm.
Arg2
[in] Value in Rs.
Return Values
None.
Remarks
The compiler translates this instruction into the miabb assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddLo_SW_ACC <armintr.h> ARM10, ARM-DSP, ARM XSCALE
See Also
Reference
ARM XSCALE Intrinsic Functions
_SmulAddHi_SW_ACC
_SmulAddHiLo_SW_ACC
_SmulAddLoHi_SW_ACC
Smart Device Development
_SmulAddLoHi_SW_ACC
_SmulAddLoHi_SW_ACC
This ARM XScale instruction multiplies the bottom half of Rm and the top half of Rs and accumulates the result to a single 40-
bit accumulator.
The instruction does not support unsigned multiplication, but interprets all arguments as signed data values.
void _SmulAddLoHi_SW_ACC(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] Value in Rm.
Arg2
[in] Value in Rs.
Return Values
None.
Remarks
The compiler translates this instruction into the miabt assembly instruction.
Requirements
Routine Required header Architecture
_SmulAddLoHi_SW_ACC <armintr.h> ARM10, ARM-DSP, ARM XSCALE
See Also
Reference
ARM DSP-enhanced Intrinsic Functions
ARM XSCALE Intrinsic Functions
_SmulAddLo_SW_ACC
_SmulAddHi_SW_ACC
_SmulAddHiLo_SW_ACC
Smart Device Development
_SmulAddPack_2SW_ACC
_SmulAddPack_2SW_ACC
This ARM XScale instruction performs two 16x16 signed multiplication on packed half word data and accumulates these to a
single 40-bit accumulator.
void _SmulAddPack_2SW_ACC(
int Arg1,
int Arg2
);
Parameters
Arg1
[in] Value in Rm.
Arg2
/QRinterwork-return - Enable Interworking Generates code that can interwork between ARM and Thumb mode.
/QRxscale - Specify XSCALE Target Generates code for Intel XScale microprocessors.
/QRxscalesched Generates code that enables internal scheduler optimizations for the XScale pip
eline.
/Qrarch{4|5} [T]
/QRxscalesched
/QRxscalesched
This option enables a re-ordering of instructions in the generated code to take advantage of XScale-specific optimizations for
internal scheduling of instruction execution.
The functionality offered by this option is a proper subset of the functionality of the /QRxscale - Specify XSCALE Target option.
See Also
Reference
ARM XSCALE Intrinsic Functions
Smart Device Development
/QRthumb
/QRthumb
This option enables the ARM Thumb instruction set.
See Also
Concepts
THUMB-enabled ARM Implementation
Smart Device Development
ARM Registers
ARM Registers
The ARM microprocessor has 16 general-purpose registers.
THUMB has eight general-purpose registers, R0-R7, and access to the high registers, R8-R15.
The following table shows the assigned register roles.
Register Description
R0 Argument1, Return Value
Temporary register
R2-R3 Arguments
Temporary registers
Note that registers R0 through R3 hold the first four words of incoming arguments. The microprocessor constructs remaining
arguments in the calling function's argument build area, which does not provide space into which R0 through R3 can be
spilled.
The following table shows additional predefined registers for Vector Floating Point and for WMMX.
Register Description
s0-s32 VFP single-precision registers
See Also
Reference
ARM Assembler Macros
Concepts
ARM Stack Frame Layout
Smart Device Development
ARM Prolog
ARM Prolog
The ARM prolog has three constituent parts. All parts are immediately contiguous, with no intervening instructions. When the
prolog follows this guideline, the Virtual Unwinder can reverse-execute the prolog.
The following list shows the three required parts of an ARM prolog.
1. A sequence of zero or one instructions that push the incoming argument values from R0, R1, R2, and R3 to the
argument home locations, and updates R13 to the new stack top.
This sequence saves all permanent registers in descending order at the top of the stack frame, following any saved
argument registers.
2. A sequence of one or more instructions that set up the frame pointer, if one is to be established.
The prolog copies stack pointer R13 to R12 before the initial register saves and uses R12 to compute the value of the
frame pointer, R11.
3. A sequence of zero or more instructions that allocate the remaining stack frame space for local variables, compiler-
generated temporaries, and the argument build area by subtracting a 4-byte aligned offset from R13.
If an offset is too wide to represent in the immediate field, the prolog uses the scratch register R12 to hold the offset. In
this case, it sets the value in R12 with a different instruction.
Examples
The following examples show how to construct several ARM prologs.
ARM Prolog with frame in R11.
MOV r12, r13 ; Save stack on entry if needed.
STMDB r13!, {r0-r3} ; As needed
STMDB r13!, {r4-r12, r14} ; As needed
SUB r11, r12, #16 ; Sets frame past args
<stack link if needed>
See Also
Concepts
SEH in RISC Environments
ARM Epilog
Smart Device Development
ARM Epilog
ARM Epilog
The ARM epilog is a contiguous sequence of instructions that does the following:
Restores the saved permanent registers
Resets the stack pointer to its value on function entry
Returns to the function's calling function
The following list shows the guidelines for implementing an epilog:
All parts are immediately contiguous, with no intervening instructions.
If a frame pointer is set up, the epilog is a single instruction that uses the frame as the base and updates all nonvolatile
registers, including the Program Counter and the stack.
If no frame is set up, the epilog consists of a stack unlink, if needed, followed by an instruction to restore multiple
registers or to copy the link register R14 to the program counter.
If the function establishes a frame pointer (which has the value of R11 for an ARM epilog), the function must not modify
the pointer value during the interval between the completion of the prolog's last instruction and the beginning of the
execution of the first instruction of the epilog.
If the function does not establish a frame pointer (which has the value of R13), the function must not modify the stack
pointer during the interval between the completion of the prolog's last instruction and the beginning of the execution of
the first instruction of the epilog.
In a routine that does not modify nonvolatile registers and is not interworking, the epilog contains only a copy of the link
register to the program counter.
A routine whose last instruction is a branch to another routine can have an empty epilog if it does not modify nonvolatile
registers.
The address contained in the stack pointer, which always has the value of R13, must never be greater than the lowest
address of any unrestored register value in the Register Save Area.
This prevents the preserved values of the permanent registers from being corrupted by a context switch or any other
asynchronous event that might occur during the execution of a prolog or epilog.
Example
The following examples show a variety of ARM epilogs.
ARM Epilog with frame in R11.
<no stack unlink>
LDMDB r11, {r4-r11, r13, r15}
See Also
Concepts
SEH in RISC Environments
ARM Prolog
Smart Device Development
THUMB Prolog
THUMB Prolog
A THUMB prolog has the following specific parts. All parts are immediately contiguous with no intervening instructions.
A sequence of zero or one instructions that push the incoming argument values in R0, R1, R2, and R3 to the argument
home locations, and updates R13 to the new stack top.
If the function does not use high registers such as R8, R9, R10, and R11, a sequence of instructions pushes R4-R7 or the
link register R14 to the stack.
The function does not push the link register if the routine is a leaf with no high registers saved.
A sequence of zero or more instructions that allocate the remaining stack frame space for local variables, compiler-
generated temporaries, and the argument build area by subtracting an aligned offset from R13.
A single instruction that sets the frame pointer if one is to be established.
Immediately after it links the stack, the function copies the value of the stack pointer in R13 to R7.
Example
The following examples show a variety of THUMB prologs.
THUMB Prolog with no frame.
PUSH {r0-r3} ; As needed
PUSH {r4-r7, LR} ; As needed
SUB SP, SP, #4 ; Stack link (as needed)
See Also
Concepts
SEH in RISC Environments
THUMB Epilog
Smart Device Development
THUMB Epilog
THUMB Epilog
The THUMB epilog is a contiguous sequence of instructions that does the following:
Restores the saved permanent registers
Resets the stack pointer to its value on function entry
Returns to the function's calling function
The following list shows important information about an epilog.
If a frame pointer has been set up by the prolog, the epilog restores the stack pointer from the frame pointer. It uses a
single mov instruction to copy R7 to R13. This copy restores R13 to the value it had just after the prolog linked the
stack.Unlinking the stack restores R13.
If {R4-R7} are to be restored, and if high registers are not to be restored, the epilog must contain an instruction to pop
{R4-R7}. This instruction updates the stack pointer. If the Unwinder restores high registers, it also restores R4-R7.
The epilog contains a sequence of zero or two instructions that pop the link register from the stack into R3.
If the routine is a leaf or if the routine restores high registers, the epilog omits this sequence.
If the epilog restores high registers, it uses a branch and link to call a restore-register routine that restores R4 through R7
and the link register. It also restores the stack pointer to the value it held just after the prolog saved {R0-R3}, or to the
value the stack pointer held on entry of the function if { R0-R3} were saved.
In a non-interworking routine that does not need to save registers other than { R4-R7,LR}, the epilog ends with pop {R4-
R7, PC} or pop { PC } if { R4-R7} do not need to be saved. If a noninterworking routine needs to save other registers, the
epilog ends with a copy of R3 to the PC.
In an interworking routine, the epilog ends with a branch and exchange (BX) to R3.
Example
The following examples show a variety of THUMB epilogs.
THUMB Epilog with no frame.
ADD SP, SP, #4 ; Stack link (as needed)
POP {r4-r7}
POP {r3} ; POP link register into r3
ADD SP, SP, #16 ; POP r0-r3 as needed
MOV PC, r3
See Also
Concepts
SEH in RISC Environments
THUMB Prolog
Smart Device Development
ENTRY_END (ARM) Ends the routine that was specified by a prior NESTED_ENTRY (ARM).
EXCEPTION_HANDLER (ARM) Associates a named exception handler with the subsequent NESTED_ENTRY (ARM).
EXCEPTION_HANDLER_DATA (A Associates a named exception handler and the handler data with the subsequent NESTED_EN
RM) TRY (ARM).
LEAF_ENTRY (ARM) Declares the beginning of a routine that does not require prolog code.
NESTED_ENTRY (ARM) Declares the beginning of a routine that either has an existing stack frame or that creates a st
ack frame.
ALTERNATE_ENTRY (ARM)
ALTERNATE_ENTRY (ARM)
This macro declares an alternate entry to a routine of type NESTED_ENTRY (ARM) or LEAF_ENTRY (ARM).
ALTERNATE_ENTRY Name[,[Section=]SectionName]
Parameters
Name
The entry point.
SectionName
The name of the section where the entry appears; see Remarks.
Return Value
None.
Remarks
Name is in the global name space.
The ALTERNATE_ENTRY macro does not use the SectionName parameter. The parameter is accepted and ignored for
consistency with NESTED_ENTRY (ARM) and LEAF_ENTRY (ARM).
If used, an ALTERNATE_ENTRY call must appear in the body of a routine.
See Also
Reference
NESTED_ENTRY (ARM)
LEAF_ENTRY (ARM)
Smart Device Development
END_REGION (ARM)
END_REGION (ARM)
This macro marks the end of a contiguous range of text or data.
END_REGION NameEnd
Parameters
NameEnd
NameEnd labels the end of the range.
Return Values
None.
Remarks
NameEnd is in the global name space.
See Also
Reference
START_REGION (ARM)
Smart Device Development
ENTRY_END (ARM)
ENTRY_END (ARM)
This macro ends the current routine specified by NESTED_ENTRY (ARM) or LEAF_ENTRY (ARM).
ENTRY_END [Name]
Parameters
Name
See Remarks.
Return Values
None.
Remarks
Name should be the same name used in the NESTED_ENTRY or LEAF_ENTRY macros.
The ENTRY_END macro ignores Name.
See Also
Reference
NESTED_ENTRY (ARM)
LEAF_ENTRY (ARM)
Smart Device Development
EXCEPTION_HANDLER (ARM)
EXCEPTION_HANDLER (ARM)
This macro associates an exception handler Handler with a subsequent NESTED_ENTRY (ARM) or LEAF_ENTRY (ARM) routine.
EXCEPTION_HANDLER Handler
Parameters
Handler
Name of the exception handler.
Return Values
None.
Remarks
This association is in effect until the compiler encounters a matching ENTRY_END (ARM) macro.
See Also
Reference
NESTED_ENTRY (ARM)
LEAF_ENTRY (ARM)
ENTRY_END (ARM)
EXCEPTION_HANDLER_DATA (ARM)
Smart Device Development
EXCEPTION_HANDLER_DATA (ARM)
EXCEPTION_HANDLER_DATA (ARM)
This macro associates an exception handler Handler and HandlerData with a subsequent NESTED_ENTRY (ARM) or
LEAF_ENTRY (ARM) routine.
Parameters
Handler
Name of the exception handler.
HandlerData
String associated with the exception handler.
Return Values
None.
Remarks
This association is in effect until compiler encounters a matching ENTRY_END (ARM) macro.
See Also
Reference
NESTED_ENTRY (ARM)
LEAF_ENTRY (ARM)
ENTRY_END (ARM)
EXCEPTION_HANDLER (ARM)
Smart Device Development
LEAF_ENTRY (ARM)
LEAF_ENTRY (ARM)
This macro declares the beginning of a routine that does not require prolog code.
LEAF_ENTRY Name[,[Section=]SectionName]
Parameters
Name
The routine name.
SectionName
Optional. The name of the section where the entry appears.Defaults to .text.
Return Values
None.
Remarks
Name is in the global name space.
A LEAF_ENTRY must have an associated ENTRY_END (ARM).
See Also
Reference
ENTRY_END (ARM)
PROLOG_END (ARM)
Smart Device Development
NESTED_ENTRY (ARM)
NESTED_ENTRY (ARM)
This macro declares the beginning of a routine that either has an existing frame or creates a stack frame.
NESTED_ENTRY Name[,[Section=]SectionName]
Parameters
Name
The routine name.
SectionName
Optional. The name of the section where the entry appears.Defaults to text.
Return Values
None.
Remarks
Name is in the global name space.
A NESTED_ENTRY must have an associated PROLOG_END (ARM) and ENTRY_END (ARM).
See Also
Reference
ENTRY_END (ARM)
PROLOG_END (ARM)
Smart Device Development
PROLOG_END (ARM)
PROLOG_END (ARM)
This macro marks the end of the prolog area.
PROLOG_END
Parameters
None.
Return Values
None.
Remarks
This macro must appear following a NESTED_ENTRY (ARM) or LEAF_ENTRY (ARM) macro.
It appears after the prolog area and before the matching ENTRY_END (ARM) macro.
See Also
Reference
NESTED_ENTRY (ARM)
LEAF_ENTRY (ARM)
ENTRY_END (ARM)
Smart Device Development
START_REGION (ARM)
START_REGION (ARM)
This macro marks the beginning of a contiguous range of text or data.
START_REGION NameBegin
Parameters
NameBegin
NameBegin labels the beginning of the range. NameBegin is in the global name space.
Return Values
None.
See Also
Reference
END_REGION (ARM)
Smart Device Development
Modifiers
Modifiers
ARM and THUMB support Microsoft-specific modifiers for interworking. The iwcall, iw16, and iw32 declspecs allow you to
select which function calls are interworking.
Compared to a linker-generated thunking routine, the iwcall or iw16 declspecs always result in faster code for interworking
calls. The declspecs add only a single MOV instruction to the execution path, while a linker-generated thunking routine adds
two instructions: a load from memory, and a branch.
See Also
Concepts
THUMB-enabled ARM Implementation
Linker-Generated Thunking Routines
Smart Device Development
iw16
iw16
When compiled by the ARM compiler, the iw16 declspec has the same effect as the iwcall declspec; that is, it makes an
interworking call.
When compiled by the THUMB compiler, the iw16 declspec has no effect.
Use the iw16 declspec only when you know which compiler, ARM or THUMB, will compile the designated function.
iw16 declspec has no effect on the ARM compiler unless you also use the /QRArch - Specify Target Architecture flag.
Using the /QRinterwork-return - Enable Interworking flag automatically enables the /QRarch flag.
See Also
Reference
iwcall
iw32
/QRinterwork-return - Enable Interworking
/QRArch - Specify Target Architecture
Concepts
Modifiers
Smart Device Development
iw32
iw32
When compiled by the THUMB compiler, the iw32 declspec has the same effect as the iwcall declspec; that is, it makes an
interworking call.
When compiled by the ARM compiler, the iw32 declspec has no effect.
Use the iw32 declspec only when you know which compiler, ARM or THUMB, will compile the designated function.
See Also
Reference
iwcall
iw16
Concepts
Modifiers
Smart Device Development
iwcall
iwcall
The iwcall declspec allows the programmer to select which function calls are interworking, regardless of whether the ARM or
THUMB compiler is used.
Using iwcall allows you to avoid link-time generation of interworking thunking routines.
Note that iwcall has no effect unless it is used on a function prototype visible to the caller.
The iwcall declspec does not cause the associated function to have an interworking return. To make an interworking return,
use the -/QRinterwork-return - Enable Interworking flag.
You can use __declspec(iwcall) on the prototype of the user-supplied function to enable the library to handle either case.
The following code example shows how to use of iwcall declspec to enable a user-supplied function myfunction().
The following listing shows the code generated from this declspec when compiled with /QRArch - Specify Target Architecture.
The following listing shows the code generated with the ARM compiler using the /QRthumboption.
push {lr}
ldr r3, [pc, #0x2]
mov r12, r3
bl __r12_indirect
pop {pc}
DCD |myfunction|
See Also
Reference
/QRinterwork-return - Enable Interworking
/QRArch - Specify Target Architecture
Concepts
Modifiers
Smart Device Development
The following code example shows the linker-generated thunking routine generated when switching from THUMB to ARM
mode.
See Also
Reference
/QRinterwork-return - Enable Interworking
/QRArch - Specify Target Architecture
Smart Device Development
See Also
Concepts
Linker-Generated Thunking Routines
Modifiers
Smart Device Development
ARM Assembler
ARM Assembler
The ARM assembler (armasm) is a two-pass assembler, processing its source files twice to reduce the amount of internal state
that it needs to keep.
The ARM assembler compiles both ARM and Thumb assembly language into the Microsoft implementation of the Common
Object File Format (COFF).
In This Section
ARM Assembler Command-Line Options
Describes the command-line syntax for invoking the ARM Assembler, and describes the command-line options.
Predeclared ARM Register Names
Provides reference information about register names that the ARM Assembler pre-declares.
Built-In ARM Assembler Variables
Provides reference information about variables that have built-in definitions for the ARM Assembler.
ARM Assembler Directives
Describes the assembler directives.
Related Sections
ARM Family Processors
Smart Device Development
The following table shows command-line options for the ARM assembler.
Option Description
-archarchitecture Sets the target architecture. Legitimate values are 4, 4T, 5, and 5T.
Some microprocessor-specific instructions produce errors or warnings if assembled for the wrong tar
get architecture.
-checkreglist Checks LDM and STM register lists to ensure that register number order is increasing.
If not, a warning is given.
You can use -checkreglist to detect misuse of symbolic register names.
-ignore 0241 -archarch Instructs the build process to ignore warning message 0241 for an instruction not implemented on th
itecture e specified target architecture.
-noregs Tells the assembler not to predefine implicit register names r0–r15, a1–a4, v1–v6, c0–c15,
p0–p15, sl, fp, ip, sp, lr, pc.
-Via file Opens file and reads in more armasm command-line arguments.
See Also
Reference
Predeclared ARM Register Names
Built-In ARM Assembler Variables
Other Resources
ARM Assembler
Smart Device Development
{VAR} or @ Contains the current value of the storage area location counter.
{CONFIG} Has the value 32 if the assembler is in 32-bit program counter mode, and the value 26 if it is in 26-bit mode.
{ENDIAN} Has the value "big" if the assembler is in big-endian mode and the value "little" if it is in little-endian mode.
{CPU} Has the name of the selected CPU or generic ARM if no CPU is specified.
NOINI Indicates that the data section is uninitialized, or initialized to zero. It contains only space reservation directives SPACE
T or DCB, DCD< DCDU, DCQ, DCQU, or DCWU with initialized values of zero.
READO Indicates that this section should not be written to. This is the default for CODE areas.
NLY
READ Indicates that this section can be read from and written to. This is the default for DATA areas.
WRITE
See Also
Reference
ARM Initialization and Layout Directives
Smart Device Development
GET GET filename Includes an additional file named filename within the current file assembly.
The included file can in turn use GET directives to include more files.
When assembly of the included file is complete, assembly continues at the line foll
owing the GET directive.
GLOB GLOBAL symbol{ Declares a symbol for use at link time by other, separate object files.
AL [FPREGARGS,DATA,LEAF]
} FPPREGARGS defines a function that expects fp arguments passed in fp registers.
DATA defines a code-segment datum rather than a function or procedure.
LEAF causes asserts that call other functions.
Identical to the EXPORT directive.
! ! arithmetic-expression Related to ASSERT, but is inspected on both passes of the assembly, providing a
, string-expression more flexible means for creating custom error messages.
If arithmetic-expression equals 0, the assembler takes no action during pass one,
but prints string-expression as a warning during pass two.
If arithmetic-expression does not equal 0, the assembler prints string-expression
as a diagnostic message. The assembly halts after pass one.
This directive is identical to the INFO directive.
INFO INFO arithmetic-express If arithmetic-expression equals 0, the assembler takes no action during pass one.
ion, string-expression
It adds source file and line number as a prefix to string-expression, and prints the
result as a warning during pass two.
If arithmetic-expression does not equal 0, the assembler prints string-expression
as a diagnostic message. The assembly halts after pass one.
This directive is identical to the ! directive.
See Also
Other Resources
ARM Assembler Directives
Smart Device Development
[ logical-expression
...code...
|
...code...
]
WHILE logical-expression
...code...
WEND
See Also
Other Resources
ARM Assembler Directives
Smart Device Development
CN label CN numeric-expr Names a coprocessor register number; c0 to c15 are predefined and cannot be u
ession sed as labels.
CP label CP numeric-expr Gives a name to a coprocessor number, if available, that must be within the rang
ession e 0 to 15.
The names p0 - p15 are predefined and cannot be used as labels.
EQU label EQU expression Gives a symbolic label to a fixed or program-relative expression.
The assembler supports global and local variables. The scope of global variables extends across the entire source file, while that
of local variables is restricted to a particular instantiation of a macro.
The following table ARM assembly directives are for setting local and global variables.
Directive Syntax Description
GBLA GBLA variable-name Defines a global arithmetic variable.
Values of arithmetic variables are 32-bit unsigned integers.
LCLA LCLA variable-name Defines a local arithmetic variable with an initial state of 0.
LCLL LCLL variable-name Defines a local logical variable with an initial state of FALSE.
LCLS LCLS variable-name Defines a local string variable with an initial state of NULL string.
Note that when you set the value of a string variable, you must use quotes.
You can declare local variables only from within a macro. In addition, after you declare a variable, you cannot use its name for
any other purpose.
The assembler substitutes values for some variables:
If a variable name has a $ character prefix, the assembler substitutes the variable value before it checks the line syntax.
If the variable is a logical or arithmetic variable, the assembler performs an .STR operation on the variable, and replaces
the variable with the result of the operation.
See Also
Other Resources
ARM Assembler Directives
Smart Device Development
MACRO
{$label}Â Â Â macroname {$parameter1}{,$parameter2}{,$parameter3}..
...code...
MEND
Remarks
A macro prototype statement must appear on the first line following the MACRO directive. The prototype tells the assembler
the name of the macro, macroname, and its parameters.
A label is optional, but is useful if the macro defines internal labels.
Any number of parameters can be used. Each must begin with $ to distinguish it from ordinary program symbols.
Within the macro body, $label, $parameter, and so on, can be used in the same way as other variables.
The $label parameter is treated as another parameter to the macro. The macro describes which labels are defined where. The
label does not represent the first instruction in the macro expansion.
For example, it is useful in a macro that uses several internal labels, such as a loop, to define each internal label as the base
label with a different suffix.
Sometimes, a value appends a macro parameter or label. Separate the appended value by a dot. After the assembler
recognizes the end of the parameter and label, the assembler ignores the dot. For example:
$label.1
$label.loop
$label.$count
Default values can be set for parameters by following them with an equal sign and the default value. If the default has a leading
or trailing space, the whole value should appear in quotes, as shown in the following code example.
...{$parameter="default value"}
The MEND directive signifies the end of the macro definition. If the macro contains WHILE/WEND loops, or contains
conditional assembly, the WHILE/WEND loop must close before execution reaches the MEND directive.
You can also terminate macro expansion with the MEXIT directive.
See Also
Other Resources
ARM Assembler Directives
Smart Device Development
KEE KEEP {symbol} Retains a local symbol in the assembler's symbol table.
P
By default, the assembler does not describe local symbols in its output object file.
If the KEEP directive appears without a symbol parameter, the assembler keeps all symbols.
To keep a specific symbol, specify it by name.
LTO LTORG Directs the assembler to assemble the current literal pool that immediately follows the asse
RG mbly.
A default LTORG is executed at every END directive that is not part of a nested assembly.
Large programs might need several literal pools, each closer to the location of their literals t
o avoid violating LDR's 4-KB offset limit.
RLI label RLIST list Assigns a name to a set of registers to be transferred by LDM or STM.
ST -of-registers
List-of-registers is a comma-separated list of register names or ranges enclosed in braces.
If you select the -CheckReglist option, you must also supply a List-of-registers list, in increasi
ng order of register number.
SUB SUBT title Specifies a subtitle to be inserted on all pages until a new subtitle appears.
T
TTL TTL title Specifies a title to be inserted on all pages until a new title appears.
See Also
Other Resources
ARM Assembler Directives
Smart Device Development
8 ARM register expected: %s Error String where the assembler tried to read a register
9 coprocessor number expected: %s Error String where the assembler tried to read a coprocess
or number
10 ARM coprocessor register expected: %s Error String where the assembler tried to read a coprocess
or register
11 ARM floating point register expected: %s Error String where the assembler tried to read a floating-p
oint register
20 wrong escape constant; null value not permitted inside Error None
a string
28 truncation applied, absolute value should be word align Warning Offset value
ed: 0x%x
45 possible infinite loop due to recursive file inclusion: %s Warning File name
49 only one source file can be assembled: %s Error Source file name
53 wrong page length: %d, 0 (non paged) assumed Warning Page length
55 illegal line start symbol: %s for directive: %s Error Start symbol, directive
57 %s attribute does not pertain to a relocatable module; ignored Warning Directive name
58 %s directive does not pertain to a relocatable module; ignored Warning Directive name
66 out of memory: section data: no object file will be generated Error None
66 out of memory: section data: no object file will be generated Error None
70 input error: line is too long after expanding an assembler variable; truncated Error None
70 input error: line is too long after expanding an assembler variable; truncated Error None
71 macro error: END directive cannot appear inside a macro Error None
71 macro error: END directive cannot appear inside a macro Error None
72 wrong directive usage: local assembler variables can only be defined within Error None
a macro
73 wrong local label reference; reference expected after %% (usage: %%{x}{y}n{ Error None
name})
76 the selected architecture and CPU (or mode) are conflicting: %s versus %s Warning Architecture, CPU
84 illegal expression type; expected absolute numeric or program relative Error None
85 illegal expression type; expected absolute numeric, program relative or regis Error None
ter relative
86 illegal expression type; expected program relative or register relative Error None
93 immediate value %d out of range; expected values: %s Warning Immediate value, string contain ex
pected values
94 improper alignment value %d; expected: [1, 2, 4, 8,   ... 32768] Error Value
95 improper alignment value %d; alignment offset should be positive and smal Warning Value
ler than alignment; truncated
96 immediate value %d out of range; positive value expected Error Immediate value
99 literal pool too far, or too close: %d; address is 8 bit offset; use LTORG Error None
10 literal pool too far, or too close: %d; address is 12 bit offset; use LTORG Error None
0
See Also
Other Resources
ARM Assembler Error Messages
Smart Device Development
10 improper rotate amount: %d; rotate amount shifted right by 1 must fit 4bits Error Immediate value
2
10 improper rotate amount: %d; only even rotate amounts can be specified Error Immediate value
3
10 immediate value out of range: %d; coprocessor information must fit in 3 bits Error Immediate value
4
10 immediate value out of range: %d; coprocessor opcode must fit in 4 bits Error Immediate value
5
10 improper line syntax, only <ldr> can be used to generate literals Error None
7
11 improper line syntax; SP or PC required as second register in this format Error None
2
11 improper line syntax; high registers are not accepted for SUB instruction Error None
3
11 improper line syntax; only SP register accepted for this format Error None
4
11 improper line syntax; high registers not allowed in this context Error None
6
11 improper line syntax; wrong combination of mnemonic and operands Error None
7
11 improper line syntax; write back '!', expected (assumed) Error None
8
11 improper line syntax; opcode, directive or macro call expected Error None
9
12 improper line syntax; %s directive cannot define a starting line symbol Error Directive name
1
12 improper line syntax; missing weak alias; symbol defined as external Warning None
3
12 improper line syntax; %s option requires %s section name Warning Option, section name
6
12 improper line syntax; selection must be 5 if <assoc= ..> option is used Warning None
8
12 improper line syntax; bad macro call; macro definition does not have a label parame Warning None
9 ter
13 improper line syntax; macro call with too many actual parameters Warning None
0
13 improper line syntax; register list symbol or proper register list ({ .. }) expected Error None
2
13 unexpected end of file in an include file/macro or missing END directive Error None
7
13 improper program syntax; missing ENDP directive or nested function definition Warning None
8
14 improper program syntax; conditional if structure crosses file (include) structure Warning None
1
14 improper program syntax; (malformed/not closed) conditional if structure appears Error None
2
14 improper program syntax; end of file or macro in WHILE loop, or missing WEND Error None
3
14 improper program syntax; a WEND directive without a preceding WHILE Error None
4
14 improper program syntax; unbalanced WHILE-WEND construction, possibly due to Warning None
5 conditionals and includes
14 improper program syntax; malformed conditional structure, possibly two ELSE key Error None
8 words in an IF construct
14 improper program syntax; nested macro definitions are not supported Error None
9
15 improper program syntax; read error or missing macro definition line Error None
0
See Also
Other Resources
ARM Assembler Error Messages
Smart Device Development
15 improper program syntax; read error, missing MEND directive or end of file inside a macro d Error None
2 efinition
15 improper program syntax; associated COMDAT section not found Error None
4
15 improper program syntax; attempt to redefine the associated COMDAT section; ignored Error None
5
15 routine name does not match the enclosing routine structure Error None
6
15 improper argument for <-predefine> command-line option: name expected Error None
7
15 improper argument for <-predefine> command-line option: %s; symbol name expected Error Command-line o
8 ption
15 improper argument for <-predefine> command-line option: SETx expected Error None
9
16 improper argument for <-predefine> command-line option; undefined symbol in expression Error None
0
16 improper argument for <-predefine> command-line option: malformed or unrecognized ex Error None
1 pression
16 improper argument for <-predefine> command-line option: expression type mismatch Error None
2
16 assembler internal error; symbol sync. error in function symbol line numbers Error None
4
16 assembler internal error; address sync. error in function symbol line numbers Error None
5
16 assembler internal error; INCLUDE path cannot be created, check INCLUDE env. variable and Warning None
6 <-i> command-line option
16 assembler internal error; source input sync. error; bad use of include or macros Error None
7
16 assembler internal error; bad macro structure in token input Error None
9
17 assembler internal error; section raw data area exceeded Error None
0
17 assembler internal error; PC sync error while generating literal pool Error None
1
17 ROUT tag of a local label does not match the enclosed ROUT name Error None
2
17 unknown command-line argument or argument value; error file name expected Error None
3
17 unknown command-line argument or argument value; include path expected Error None
4
17 unknown command-line argument or argument value; list file name expected Error None
5
17 unknown command-line argument or argument value; obj file name expected Error None
6
17 unknown command-line argument or argument value; width value expected Error None
7
17 unknown command-line argument or argument value; length value expected Error None
8
17 unknown command-line argument or argument value; SET directive expected Error None
9
18 unknown command-line argument or argument value; <-via> file name expected Error None
0
18 attribute does not pertain to a relocatable module; ignored, weak expected Error None
2
18 multiple symbol definition or incompatibility; weak alias must be external Error None
3
18 multiple symbol definition or incompatibility; procedure name must have address 0 if it is an Error None
4 area COMDAT symbol
18 multiple symbol definition or incompatibility; multiple definitions of section COMDAT symbo Error None
5 l as function name
18 multiple symbol definition or incompatibility; an assembler variable cannot be exported; exp Error None
6 ort attribute deleted
18 multiple symbol definition or incompatibility; a register relative symbol cannot be exported; Error None
7 export attribute deleted
18 multiple symbol definition or incompatibility; program counter symbol cannot be exported; e Error None
8 xport attribute deleted
18 multiple symbol definition or incompatibility; a string symbol cannot be exported; export attr Error None
9 ibute deleted
19 multiple symbol definition or incompatibility; truncation possible on a float absolute exporte Error None
0 d symbol
19 illegal symbol %s; a built-in variable cannot be used as a COMDAT symbol; ignored Error Symbol
1
2 illegal macro syntax: %s; comma or end of line expected Error Line
0
3
2 illegal macro syntax: %s; improper component of a macro definition Error Line
0
4
2 wrong expression operand: %d; positive value expected Error Value in expression
0
8
2 error while reading input file: input stack overflow, possible infinite recursion o Error None
1 n file include or macro calls
0
2 error while reading input file: line too long on input file Error None
1
2
2 error while reading input file: macro expanded line too long Error None
1
3
2 error while reading input file: input stack overflow, possible infinite recursion o Error None
1 n file include or macro calls
4
2 the selected architecture and CPU (or mode) are conflicting %s; BX instruction Error None
1 not defined for this architecture
9
2 the selected architecture and CPU (or mode) are conflicting; <Thumb Area opti Warnin None
2 on> and <command-line arch: not 4T> g
0
2 illegal flag(s); only <cpsr_f> or <spsr_f> can be used with immediate value Warnin None
2 g
1
2 operand restriction violation (undefined behavior): same source and dest reg Warnin None
2 g
2
2 operand restriction violation (undefined behavior): same base and offset reg Warnin None
2 g
3
2 command-line option not implemented; %s assumed; %s ignored Warnin Command-line argument that is ass
2 g umed, or that is not implemented
5
2 illegal combination of section flags: section flags cannot be inferred, code and Warnin None
2 data/uninitialized, readonly/readwrite g
6
2 syntax error in expression Error None
2
7
2 condition codes are not accepted for this form of blx instruction; cc ignored Warnin None
3 g
0
2 unknown floating point system register: %s; expected: FPSID, FPSCR or FPEXC Error String with floating register
3
1
2 wrong floating point register list; a compact group of registers is expected Error None
3
2
2 The following usage is no longer supported : armasm [<options>] sourcefile Warnin None
4 objectfile\n g
3 Please use the ""-o"" option:
armasm [<options>] -o objectfile sourcefile\n
2 Literal pool entry could not be found in second pass. Check to make sure the e Error None
4 xpression and all dependent symbols are fully defined before their use.
5
See Also
Other Resources
ARM Assembler Error Messages
Smart Device Development
_Dot3dVW0 Computes the inner product of a pair of three- or four-dimensional vectors with the "w" coordinate forced to
0.
_Dot3dVW1 Computes the inner product of a pair of three- or four-dimensional vectors with the "w" coordinate forced to
1.
__fmac Multiplies two float values and adds to a third float value.
_LoadMatrix Loads a 4x4 matrix into the extended floating-point register bank.
_SaveMatrix Stores the extended floating-point register bank into a 4x4 matrix.
__fmac
__fmac
Multiplies two float values and add to a third float value.
Float __fmac(
float Arg1,
float Arg1,
float Arg1
);
Parameters
Arg1
[in] First operand of the multiplication operation.
Arg2
[in] Second operand of the multiplication operation.
Arg3
[in] Value to which the product of Arg1and Arg2 is added.
Return Values
The sum of the product of Arg1 and Arg2 with Arg3.
Remarks
The following code example shows how to use _fmac.
/***********************************************************/
#include <stdio.h>
#include <shintr.h>
void main()
{
int i;
float sum=0;
float v1[4] = {2.0, 2.0, 2.0, 2.0};
float v2[4] = {8.0, 8.0, 8.0, 8.0};
for (i = 0; i < 4; i++)
sum = __fmac(v1[i], v2[i], sum);
sum = 64.000000
Requirements
Routine Required header Architecture
__fmac <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
Smart Device Development
__movca
__movca
Move with cache block allocation.
void __movca(
unsigned long value,
unsigned long* addr
);
Parameters
value
[in] Specifies longword to store in memory.
addr
[in] Address in memory to be accessed.
Return Values
None.
Remarks
The following code example shows how to use _prefetch with _moveca.
#include <stdio.h>
#include <shintr.h>
if (addr[0] != 0xffff)
printf("error\n");
__movca(value, addr);
printf("after movca addr value = %x\n", addr[0]);
if (addr[0] != value)
printf("error\n");
}
Requirements
Routine Required header Architecture
__movca <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_prefetch
Smart Device Development
_Convolve
_Convolve
Computes the summation of two vectors.
Float _Convolve(
int nelement,
float* pstart,
float* pend,
float* pdata,
float* pfilter
);
Parameters
nelement
/*****************************************************************
_Convolve: summation of two vector
pstart | A0 | pfilter | X0 |
| A1 | | X1 |
| .. | | .. |
pdata | Ai | | .. |
| .. | | .. |
pend | An | | Xn |
For example:
nelement = 4;
result = (Ai * X3) + (Ai+1 * X2) + (Ai+2 * x1) + (Ai+3 * x0)
nelement = n+i;
result = (Ai * Xn) + (Ai+1 * Xn-1) + .. + (Ai-1 * X0)
*****************************************************************/
#include <stdio.h>
#include <shintr.h>
#include <stdio.h>
void main()
{
float pdata[5] = {1.0,2.0,3.0,4.0,5.0};
float filter[5] = {1.0,2.0,3.0,4.0,5.0};
float output;
float *pstart = pdata;
float *pend = pdata+4;
Output
output = 35.000000
output = 45.000000
output = 50.000000
output = 50.000000
output = 45.000000
Requirements
Routine Required header Architecture
_Convolve <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
Smart Device Development
_Dot3dVW0
_Dot3dVW0
Computes the inner product of a pair of three or four-dimensional vectors with the "w" coordinate forced to 0.
float _Dot3dVW0(
float* vector1,
float* vector2
);
Parameters
Vector1
[in] Pointer to a three or four-dimensional source vector.
Vector2
[in] Pointer to a three or four-dimensional destination vector.
Return Values
The scalar resulting from the inner product.
Remarks
The fourth coordinate of a source vector will always force to 0.
To implement this function, use the /Qsh4 /Oi (Generate Intrinsic Functions) flag when compiling.
The following code example shows how to use Dot3dVW0 to compute the inner products of three or four dimensional
vectors.
/***********************************************************/
#include <stdio.h>
#include <shintr.h>
void main()
{
float result;
float v1[4]={1.0,2.0,3.0,4.0};
float v2[4]={2.0,3.0,4.0,5.0};
result = _Dot3dVW0(v1,v2);
/***********************************************************/
printf("result=%f\n", result);
}
retval=20.000000
Requirements
Routine Required header Architecture
_Dot3dVW0 <shintr.h> SH-4
See Also
Reference
_Dot4dV
_Dot3dVW1
Intrinsic Functions for Renesas Microprocessors
Smart Device Development
_Dot3dVW1
_Dot3dVW1
Computes the inner product of a pair of three or four-dimensional vectors with the "w" coordinate forced to 1.
float _Dot3dVW1(
float* vector1,
float* vector2
);
Parameters
vector1
[in] Pointer to a three or four-dimensional source vector.
vector2
[in] Pointer to a three or four-dimensional destination vector.
Return Values
The scalar resulting from the inner product.
Remarks
The fourth coordinate of the source vector will always force to 1.
To implement this function, use the -QSh4 /Oi (Generate Intrinsic Functions) flag when compiling.
The following code example shows how to compute the inner products of three or four dimensional vectors.
/***********************************************************/
#include <stdio.h>
#include <shintr.h>
void main()
{
float retval;
float v1[3] = {1.0, 2.0, 3.0};
float v2[3] = {2.0, 3.0, 4.0};
retval = _Dot3dVW1(v1, v2);
/***********************************************************/
printf("retval=%f\n", retval);
}
retval=21.000000
Requirements
Routine Required header Architecture
_Dot3dVW1 <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Dot4dV
_Dot3dVW0
Smart Device Development
_Dot4dV
_Dot4dV
Computes the inner product of a pair of four-dimensional vectors.
float _Dot4dV(
float* vector1,
float* vector2
);
Parameters
vector1
[in] Pointer to a four-dimensional source vector.
vector2
[in] Pointer to a four-dimensional destination vector.
Return Values
The scalar resulting from the inner product.
Remarks
The following code example shows how to compute the inner product of four-dimensional vectors.
/***********************************************************/
#include <stdio.h>
#include <shintr.h>
void main()
{
float retval;
float v1[4] = {1.0, 2.0, 3.0, 4.0};
float v2[4] = {2.0, 3.0, 4.0, 5.0};
retval = _Dot4dV(v1, v2);
printf("retval=%f\n", retval);
}
retval=40.000000
Requirements
Routine Required header Architecture
_Dot4dV <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Dot3dVW0
_Dot3dVW1
Smart Device Development
_LoadMatrix
_LoadMatrix
Loads a 4x4 matrix into the extended floating-point register bank.
float* _LoadMatrix(
float* matrix
);
Parameters
matrix
[in] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix.
Return Values
Pointer to the 4x4 matrix that has been loaded.
Remarks
The following code example shows how to use _LoadMatrix.
#include <stdio.h>
#include <shintr.h>
void main()
{
int i,j;
float result[4][4];
// #########################################################
float m1[4][4] = {1.0,1.0,1.0,1.0,
2.0,2.0,2.0,2.0,
3.0,3.0,3.0,3.0,
4.0,4.0,4.0,4.0};
// #########################################################
float m2[4][4] = {2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0};
// #########################################################
_LoadMatrix(m1); //Load m1 matrix into XD bank regs
_XDMultMatrix(m2); //[m1]x[m2] Saved result into XD bank regs
_SaveMatrix(result); //Load XD bank regs into result buffer
// Print out result
printf("Result of [m1]x[m2] = \n");
for (i = 0; i < 4; i++)
{
printf("| ");
for (j =0; j < 4; j++)
printf("%8.4f ", result[i][j]);
printf(" |\n");
}
}
Result of [m1]x[m2] =
| 8.0000 8.0000 8.0000 8.0000 |
| 16.0000 16.0000 16.0000 16.0000 |
| 24.0000 24.0000 24.0000 24.0000 |
| 32.0000 32.0000 32.0000 32.0000 |
Requirements
Routine Required header Architecture
_LoadMatrix <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_SaveMatrix
Smart Device Development
_Multiply4dM
_Multiply4dM
Multiplies a 4x4 matrix by a 4x4 matrix.
float* _Multiply4dM(
float* result,
float* matrix1,
float* matrix2
);
Parameters
result
[out] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix. This matrix receives the result of the operation.
matrix1
[in] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix.
matrix2
[in] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix.
Return Values
Pointer to the 4x4 result matrix.
Remarks
The following code example shows how to use _Multiply4DM.
void main()
{
int i,j;
float result[4][4];
float m1[4][4] = {1.0,1.0,1.0,1.0,
2.0,2.0,2.0,2.0,
3.0,3.0,3.0,3.0,
4.0,4.0,4.0,4.0};
float m2[4][4] = {2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0,
2.0,2.0,2.0,2.0};
Multiply4dM(result, m1, m2);
printf("Result of [m1]x[m2] = \n");
for (i = 0; i < 4; i++)
{
printf("| ");
for (j = 0; j < 4; j++)
printf("%8.4f ",result[i][j]);
printf(" |\n");
}
}
Output
Result of [m1]x[m2] =
| 8.0000 8.0000 8.0000 8.0000 |
| 16.0000 16.0000 16.0000 16.0000 |
| 24.0000 24.0000 24.0000 24.0000 |
| 32.0000 32.0000 32.0000 32.0000 |
Requirements
Routine Required header Architecture
_Multiply4dM <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_XDMultMatrix
Smart Device Development
_SaveMatrix
_SaveMatrix
Stores the extended floating-point register bank into a 4x4 matrix.
float* _SaveMatrix(
float* matrix
);
Parameters
matrix
[out] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix.
Return Values
Pointer to the 4x4 matrix that has been stored.
Remarks
The following code example shows how to use _SaveMatrix.
void main()
{
int i,j;
float result[4][4];
float m1[4][4] = {1.0,1.0,1.0,1.0,
2.0,2.0,2.0,2.0,
3.0,3.0,3.0,3.0,
4.0,4.0,4.0,4.0};
//
// Print out the result
//
printf("Result of [m1]x[m2] = \n");
for (i = 0; i < 4; i++)
{
printf("| ");
for (j = 0; j < 4; j++)
printf("%8.4f ",result[i][j]);
printf(" |\n");
}
_XDMultMatrix(m2); //[m1]x[m2]x[m2]->saved results into XD bank
_SaveMatrix(result); //Load XD bank regs into result buffer
//
// Print out the result
//
printf("\nResult of [m1]x[m2]x[m2] = \n");
for (i = 0; i < 4; i++)
{
printf("| ");
for (j = 0; j < 4; j++)
printf("%8.4f ",result[i][j]);
printf(" |\n");
}
}
Output
Result of [m1]x[m2] =
| 8.0000 8.0000 8.0000 8.0000 |
| 16.0000 16.0000 16.0000 16.0000 |
| 24.0000 24.0000 24.0000 24.0000 |
| 32.0000 32.0000 32.0000 32.0000 |
Result of [m1]x[m2]x[m2] =
| 64.0000 64.0000 64.0000 64.0000 |
| 128.0000 128.0000 128.0000 128.0000 |
| 192.0000 192.0000 192.0000 192.0000 |
| 256.0000 256.0000 256.0000 256.0000 |
Requirements
Routine Required header Architecture
_SaveMatrix <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_LoadMatrix
Smart Device Development
_XDMultMatrix
_XDMultMatrix
Multiplies a 4x4 matrix by a 4x4 matrix. This instruction requires one of the matrices to have been previously loaded into the
extended floating-point register bank. The matrix passed as the parameter receives the result of the operation.
void _XDMultMatrix(
float* matrix
);
Parameters
matrix
[in, out]Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix.
Return Values
None.
Requirements
Routine Required header Architecture
_XDMultMatrix <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Multiply4dM
_LoadMatrix
_SaveMatrix
Smart Device Development
_XDXform3dV
_XDXform3dV
Multiplies a three-dimensional vector by a 3x3 matrix. This instruction requires that the matrix has been previously loaded into
the extended floating-point register bank.
float* _XDXform3dV(
float* src,
float* dst
);
Parameters
src
[in] Pointer to a three-dimensional source vector.
dst
printf("Matrix:\t\t\tSrc:\tDest:\n");
}
void main()
{
int i;
float dest[6];
float src[6] = {1.0,2.0,3.0,
4.0,5.0,6.0,};
float matrix[16]= {1.0, 2.0, 3.0, 4.0,
5.0, 6.0, 7.0, 8.0,
9.0, 10.0, 11.0, 12.0,
13.0, 14.0, 15.0, 16.0};
_LoadMatrix(matrix); //Load matrix into XD bank registers
for (i = 0; i < 6; i +=3)
_XDXform3dV(src+i, dest+i); //[matrix]x[src[i]] --> dest[i]
Output
Requirements
Routine Required header Architecture
_XDXform3dV <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Xform3dV
_Xform4dV
_XDXform4dV
_LoadMatrix
_SaveMatrix
Smart Device Development
_XDXform4dV
_XDXform4dV
Multiplies a four-dimensional vector by a 4x4 matrix. This instruction requires that the matrix has been previously loaded into
the extended floating-point register bank.
float* _XDXform4dV(
float* src,
float* dst
);
Parameters
src
[in] Pointer to a three-dimensional source vector.
dst
Output
Requirements
Routine Required header Architecture
_XDXform4dV <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Xform3dV
_Xform4dV
_LoadMatrix
_SaveMatrix
Smart Device Development
_Xform3dV
_Xform3dV
Multiplies a three-dimensional vector by a 3x3 matrix. This intrinsic will load a constant zero into Bank1 floating-point registers
(fr12, fr13, fr14, fr15) and Bank0 floating-point register (fr3).
float* _Xform3dV(
float* dst,
float* src,
float* matrix
);
Parameters
dst
printf("Matrix:\t\t\tSrc:\tDest:\n");
for (row = 0; row < 3; row++)
{
printf("| ");
for (col = 0; col < 3; col++)
{
printf("%6.2f", *matrix++);
}
printf(" |");
printf(" |%6.2f|", *src++);
printf("\t|%10.4f|\n", *dest++);
}
}
void main()
{
int i;
float dest[3];
float src[3] = {1.0, 2.0, 3.0}
float matrix[9]={1.0, 2.0, 3.0,
4.0, 5.0, 6.0,
7.0, 8.0, 9.0};
_Xform3dV(dest, src, matrix); // [matrix]x[src[i]] Ã dest[i]
print_matrix(matrix, src, dest);
}
Output
Matrix: Src: Dest:
| 1.00 2.00 3.00 | | 1.00| | 14.0000|
| 4.00 5.00 6.00 | | 2.00| | 32.0000|
| 7.00 8.00 9.00 | | 3.00| | 50.0000|
Requirements
Routine Required header Architecture
_Xform3dV <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Xform4dV
_XDXform4dV
_XDXform3dV
_LoadMatrix
_SaveMatrix
Smart Device Development
_Xform4dV
_Xform4dV
Multiplies a four-dimensional vector by a 4x4 matrix.
float* _Xform4dV(
float* dst,
float* src,
float* matrix
);
Parameters
dst
[out] Pointer to a four-dimensional destination vector.
src
[in] Pointer to a four-dimensional source vector.
matrix
[in] Pointer to an array of float values arranged such that the indices of the array are the [row][column] values of the 4x4
matrix.
Return Values
Pointer to the four-dimensional destination vector.
Remarks
The following code shows how to use _Xform4dV.
printf("Matrix:\t\t\t\tSrc:\tDest:\n");
void main()
{
int i;
float dest[4];
float src[4] = {1.0,2.0,3.0,4.0};
Requirements
Routine Required header Architecture
_Xform4dV <shintr.h> SH-4
See Also
Reference
Intrinsic Functions for Renesas Microprocessors
_Xform3dV
_XDXform4dV
_XDXform3dV
_LoadMatrix
_SaveMatrix
Smart Device Development
-QSh4
-QSh4
This option specifies compilation for the Renesas SH-4 microprocessor.
See Also
Reference
Renesas Compiler Options
Smart Device Development
R4-R Hold the first four words of integer and non-scalar incoming arguments. The argument build area provides space into
7 which R4 through R7 holding arguments may spill.
Not preserved.
R14 Serves as the default frame pointer. Any other permanent register may serve as the frame pointer, and leaf routines ma
y use a temporary register as the frame pointer.
Preserved.
The SH-4 has two banks of 16 floating-point registers designated Bank0 and Bank1. This specification does not define the use
of Bank1. This calling convention assigns the following roles to the SH-4 Bank0 floating-point registers.
Double-Precis Single-Precisi Description
ion Register on Register
DR0 FR0 Hold function return values. DR0 is another name for the single-precision registers FR0 and F
R1 as a pair.
FR1
DR2 FR2-FR3 Serve as temporary registers. DR2 is another name for FR2 and FR3 as a pair.
Not preserved
DR4-DR10 FR4-FR11 Hold single- or double-precision floating-point arguments. The argument build area also provi
des space into which floating-point registers holding arguments may spill.
The floating-point status control affects the behavior of some floating-point instructions. For information about the use of the
PR, SZ, and FR bits within prologs and epilogs, see Renesas SH-4 Prolog and Epilog.
See Also
Concepts
Renesas SH-4 Stack Frame Layout
Other Resources
Renesas SH-4 Prolog and Epilog
Smart Device Development
SH-4 Prolog
SH-4 Prolog
The SH-4 prolog contains four parts that are immediately contiguous with no intervening instructions. The following list shows
the required parts.
1. A sequence of zero or more instructions that save the incoming argument values from R4 - R7 and FR4 - FR11 to the
argument home locations.
This sequence typically uses the fmov instruction with R15 as the base address register. This sequence will not change
the stack pointer, R15.
In addition, floating-point argument registers can be stored onto the stack using the fmov instruction with the register-
indirect and register-indirect-pre-decrement addressing modes.
A sequence of one or more such fmov instructions may be preceded by a two-instruction address register setup
sequence composed of a constant move to a general register, followed by an add of the sp to the register. For example:
mov #36, r0
add sp, r0
fmov fr5, @r0
fmov fr4, @-r0
2. A sequence of zero or more instructions that push all permanent registers to be saved and the return address (PR), if it is
to be saved, onto the stack using the pre-decrement indirect register addressing mode with R15 as the address register.
If a permanent register such as R14 is to be used as the frame pointer, it is pushed first.
If the PR is to be saved, it is pushed last.
The prolog uses mov.l instructions to save registers other than the return address, and the sts.l instruction to save the
return address.
The prolog also uses the fmov.s instruction to save floating-point registers, and may invoke double-precision and move-
extension fmov instructions by first setting the SZ bit in the FPSCR.
3. A sequence of one or more instructions that set up the frame pointer, if one is to be established.
To set up the frame pointer, the step 3 sequence first copies the contents of R15 to the frame pointer register, then adds
or subtracts the amount of offset to the frame pointer address from the frame pointer register.
If the frame pointer address is less than the current value in R15, the prolog subtracts the offset to the frame pointer
address from R15, and copies R15 to the frame pointer register. If this method is used, the routine must later take the
size of the decrement to R15 into account.
If the routine is not a leaf routine, the function must use a permanent register, typically R14, as the frame pointer.
4. A sequence of zero or more instructions that allocate the remaining stack frame space for local variables, compiler-
generated temporaries, and the argument-build area by subtracting a 4-byte aligned offset from R15.
The Virtual Unwinder considers the last instruction in this sequence the last instruction of the prolog.
If necessary, the temporary register R1 holds an offset too large to be represented in the immediate field of an add instruction.
See Also
Concepts
SH-4 Epilog
SH-4 Prolog and Epilog Examples
Other Resources
Renesas SH-4 Prolog and Epilog
Smart Device Development
SH-4 Epilog
SH-4 Epilog
The SH-4 epilog is a contiguous sequence of instructions that restores the saved permanent registers, resets the stack pointer
to its value on function entry, and returns to the function's calling function.
In addition, the Virtual Unwinder requires the epilog to have the following parts, except where noted:
1. A single add instruction that increments the frame pointer. This instruction must immediately precede the sequence of
instructions defined for part 2. (Optional)
2. A sequence of instructions that modify R15 by referencing it in the destination operand of the instruction or in a post-
increment memory address operand of the instruction. This sequence immediately precedes the rts instruction of part 3.
All instructions in this sequence must be lds, mov, fmov, fschg, or add instructions.
This item is optional. It does not appear in functions that have no RSA area to restore.
3. The rts instruction and its delay slot instruction. The instruction in the delay slot of the rts is considered part of the epilog
but is not required to conform to the rules listed for item 2.
When unwinding out of a function, the Virtual Unwinder must determine if the currently executing instruction is in the prolog
or epilog. If the current point of control is in the prolog or in the epilog, the Virtual Unwinder must take special measures to
unwind out of the function.
The following list shows three conditions that the Virtual Unwinder must maintain:
If the function establishes a frame pointer, the function may not modify the frame pointer value during the interval
between the completion of the last prolog instruction and the beginning of the first instruction of the epilog.
If the function does not establish a frame pointer, the function must not modify value in R15 during the interval between
the completion of the last prolog instruction and the beginning of the first instruction of the epilog.
The address contained in the stack pointer, which is always R15, must never be greater than the lowest address of any
unrestored register value in the Register Save Area.
The SZ, PR, and FR bits of the FPSCR register must always be set to zero on entering and exiting the prolog and epilog.
The PR and FR bits must not be modified within the prolog or epilog. This condition enables the Virtual Unwinder to
correctly reverse-execute floating-point instructions.
See Also
Concepts
SH-4 Prolog
SH-4 Prolog and Epilog Examples
Other Resources
Renesas SH-4 Prolog and Epilog
Smart Device Development
NESTED_ENTRY Function
PROLOG_END
// Routine body
// Epilog
ENTRY_END Function
NESTED_ENTRY Function
PROLOG_END
// Routine body
ENTRY_END Function
See Also
Reference
SH-4 Assembler Macros
Other Resources
Renesas SH-4 Prolog and Epilog
Smart Device Development
ENTRY_END (SH-4) Ends the routine that was specified by a prior NESTED_ENTRY.
EXCEPTION_HANDLER (SH-4) Associates a named exception handler with the subsequent NESTED_ENTRY.
EXCEPTION_HANDLER_DATA (S Associates a named exception handler and the handler data with the subsequent NESTED_EN
H-4) TRY.
LEAF_ENTRY (SH-4) Declares the beginning of a routine that does not require any prolog code.
NESTED_ENTRY (SH-4) Declares the beginning of a routine that either has an existing stack frame or creates a new st
ack frame.
ALTERNATE_ENTRY (SH-4)
ALTERNATE_ENTRY (SH-4)
This macro declares an alternate entry to a routine of type NESTED_ENTRY (SH-4) or LEAF_ENTRY (SH-4).
ALTERNATE_ENTRY Name[,
[Section=]SectionName]
Parameters
Name
Name is the entry point and is in the global name space.
SectionName
SectionName is the name of the section in which the entry will appear; see Remarks.
Return Values
None.
Remarks
The ALTERNATE_ENTRY macro does not use the SectionName parameter. The parameter is accepted and ignored for
consistency with NESTED_ENTRY and LEAF_ENTRY.
If used, an ALTERNATE_ENTRY call must appear in the body of a routine.
See Also
Reference
NESTED_ENTRY (SH-4)
LEAF_ENTRY (SH-4)
Smart Device Development
END_REGION (SH-4)
END_REGION (SH-4)
This macro marks the end of a contiguous range of text or data.
END_REGION NameEnd
Parameters
NameEnd
NameEnd labels the end of the range.
Return Values
None.
Remarks
NameEnd is in the global name space.
See Also
Reference
START_REGION (SH-4)
Smart Device Development
ENTRY_END (SH-4)
ENTRY_END (SH-4)
This macro ends the current routine specified by NESTED_ENTRY (SH-4) or LEAF_ENTRY (SH-4).
ENTRY_END [Name]
Parameters
Name
Name is the entry point and is in the global name space.See Remarks.
Return Values
None.
Remarks
Name should be the same name used in the NESTED_ENTRY or LEAF_ENTRY macros.
The ENTRY_END (SH-4) macro currently ignores Name.
See Also
Reference
NESTED_ENTRY (SH-4)
LEAF_ENTRY (SH-4)
Smart Device Development
EXCEPTION_HANDLER (SH-4)
EXCEPTION_HANDLER (SH-4)
This macro associates an exception handler Handler with a subsequent NESTED_ENTRY (SH-4) or LEAF_ENTRY (SH-4) routine.
EXCEPTION_HANDLER Handler
Parameters
Handler
Name of exception handler.
Return Values
None.
Remarks
This association is in effect until the compiler encounters a matching ENTRY_END (SH-4) macro.
See Also
Reference
NESTED_ENTRY (SH-4)
LEAF_ENTRY (SH-4)
ENTRY_END (SH-4)
Smart Device Development
EXCEPTION_HANDLER_DATA (SH-4)
EXCEPTION_HANDLER_DATA (SH-4)
This macro associates an exception handler Handler and the HandlerData with a subsequent NESTED_ENTRY (SH-4) or
LEAF_ENTRY (SH-4) routine.
EXCEPTION_HANDLER_DATA Handler,
HandlerData
Parameters
Handler
Name of exception handler.
HandlerData
LEAF_ENTRY (SH-4)
LEAF_ENTRY (SH-4)
This macro declares the beginning of a routine that does not require any prolog code.
LEAF_ENTRY Name[,
[Section=]SectionName]
Parameters
Name
Name is the routine name and is in the global name space.
SectionName
SectionName is the name of the section in which the entry will appear; it is optional and defaults to .text.
Return Values
None.
Remarks
A LEAF_ENTRY must have an associated ENTRY_END (SH-4).
See Also
Reference
ENTRY_END (SH-4)
PROLOG_END (SH-4)
Smart Device Development
NESTED_ENTRY (SH-4)
NESTED_ENTRY (SH-4)
This macro declares the beginning of a routine that either has an existing frame or creates a stack frame.
NESTED_ENTRY Name[,
[Section=]SectionName]
Parameters
Name
Name is the routine name and is in the global name space.
SectionName
SectionName is the name of the section in which the entry will appear; it is optional and defaults to text.
Return Values
None.
Remarks
A NESTED_ENTRY must have an associated PROLOG_END (SH-4) and ENTRY_END (SH-4).
See Also
Reference
ENTRY_END (SH-4)
PROLOG_END (SH-4)
Smart Device Development
PROLOG_END (SH-4)
PROLOG_END (SH-4)
This macro marks the end of the prolog area.
PROLOG_END
Parameters
None.
Return Values
None.
Remarks
This macro must appear following a NESTED_ENTRY (SH-4) or LEAF_ENTRY (SH-4) macro.
It appears after the prolog area and before the matching ENTRY_END (SH-4) macro.
See Also
Reference
NESTED_ENTRY (SH-4)
LEAF_ENTRY (SH-4)
ENTRY_END (SH-4)
Smart Device Development
START_REGION (SH-4)
START_REGION (SH-4)
This macro marks the beginning of a contiguous range of text or data.
START_REGION NameBegin
Parameters
NameBegin
NameBegin labels the beginning of the range. NameBegin is in the global name space.
Return Values
None.
See Also
Reference
END_REGION (SH-4)
Smart Device Development
When you specify multiple source files on the command line, the assembler creates a unit of assembly processing by
concatenating the specified files in the specified order. Because of this, the .END directive must appear only in the last file.
Command line options can begin with either a - (hyphen) or a / (slash). File names can be specified with forward or backward
slashes.
If the assembler has the option of interpreting an argument as either a command line option or a file name, the argument will
be interpreted as a command line option. For example, if a file called /source.src is assembled by writing shasm /source, the
assembler interprets /source as a switch, and issues a message that there are no input files.
Command line options provide additional specifications for the assembly processing. The following table shows the command
line options for the SH-4 assembler.
Command line opt Description
ion
-OBJECT Specifies output of an object module. Default value.
-NOSHOW Suppresses output of specified preprocessor function source statements and object code display lines in t
he source program listing.
-FoOBJPATH Sets the path to which the object should be written. A synonym for the -o=OBJPATH option. Provided for
compatibility with Microsoft-based tools.
-wide[_listing] Shows up to eight bytes of machine code or data per line in the assemble listing. Default is four bytes per
line.
-nowide[_listing] Shows up to four bytes of machine code or data per line in the assemble listing. This is the default behavi
or.
-tab[_expand][=<nu Expands tab characters in the assemble listing. The number, if specified, is the spacing of tab stops. Defaul
mber>] t is eight.
-Notab[_expand] Writes tab characters into the assemble listing unchanged. This is the default behavior.
-maxerr[ors]=<num Aborts the assembly after <number> errors have been reported. Default is 100.
ber>
-Qsh<version>[r<r Selects SH microprocessor version and revision that control the setting of the _M_SH and _M_SH_REV pr
evision>] edefined symbols. Default is version SH-4.
-help -usage Output a detailed command line usage message and exit immediately.
-CPU=SH<version> Selects target CPU for the source program being assembled. Valid options are:
SH1
SH2
SH4
The assembler listing is a listing to which the results of the assembly processing are output.
Note that when compiling an assembly source file that ends in .s, in contrast to .asm or .src, then the output object file
concatenates .obj to the end of the file name. For example, a file named test.s is assembled to test.s.obj.
Return Codes
The assembler delivers a return code that reports whether or not the assembly processing terminated normally. The following
table shows the return values that indicate the activity at termination.
Activity Return value
Normal termination 0
Warnings occurred 0
Errors occurred 2
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
.ALIG .ALIGN <boundary alignment value> Adjusts the value of the location counter to a multiple of
N boundary alignment value.
boundary alignment value must be an absolute value wit
h no forward reference symbols.
The assembler also provides a default section for the situations in which no section has been declared.
The following list shows the kinds of statements and instructions for which SHASM provides a default section.
Executable instructions
Data reservation assembler directives
.ALIGN assembler directive
.ORG assembler directive
Reference to the location counter
Statements consisting of only the label field
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
.AS <symbol>[:] .ASSIGN <symbol Sets a symbol value that can be redefined.
SIG value>
N
.SDA [<symbol>[:]] .SDATAB <block count>,<char Reserves character string data blocks.
TAB acter string>
.SDA [<symbol>[:]] .SDATAC <character string>[ Reserves character string data with length.
TAC ,<character string>...]
.SDA [<symbol>[:]] .SDATACB <block count>,<cha Reserves specified number of character string data blocks
TACB racter string> with length.
A character string with length is a character string with an
inserted leading byte that indicates the length of the string
.
.SDA [<symbol>[:]] .SDATAZ <character string>[ Reserves character string data with zero terminator.
TAZ ,<character string>...]
.SDA [<symbol>[:]] .SDATAZB <block count>,<cha Reserves specified number of character string data blocks
TAZB racter string> with zero terminator.
.SRE [<symbol>[:]] .SRES <character string are Reserves character string data area.
S a size>[,<character string area size>...]
The character string area size specification must be an abs
olute value with no forward reference symbols.
.SRE [<symbol>[:]] .SRESC <character string ar Reserves character string data area with length.
SC ea size>[,<character string area size>...
] A character string with length is a character string with an
inserted leading byte that indicates the length of the string
.
.SRE [<symbol>[:]] .SRESZ <character string ar Reserves character string data area with zero terminator.
SZ ea size>[,<character string area size>...
]
String constants in the .SDATA family of directives are allowed to be one or more of the following in any combination:
"quoted string"
<control char expression>
The assembler requires that parentheses be put around string constants if they are to be used as part of more complicated
expressions such as string comparisons in .SDATA and related directives.
In all other contexts, string constants can only be double-quoted strings, and can be used without parentheses.
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
.PDAT .PDATA <handler address Specifies language-specific exception-handling information for current function.
A >[,<handler data>]
The .PDATA directive must appear before the .ENTRY or .BIGENTRY section to w
hich it applies.
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
.DEBUG .DEBUG <output specifier> Controls the output of symbolic debug information.
Specifications concerning debug information output are only valid when an object module is output.
The following table shows possible values for output specifier.
Output Specifier Description
OBJ (default) An object module is output.
The .DEBUG directive specification is valid only when both an object module and debug information are output.
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
.LIST .LIST <output specifier>[,<output specifier>...]Output specifier:{ ON|OFF|COND| Controls the output of the source prog
NOCOND|DEF|NODEF| CALL|NOCALL|EXP| NOEXP|CODE|NOCODE} ram listing.
For more information, see SH-4 Asse
mbler LIST Directive Specifiers.
.FOR .FORM <size specifier>[,<size specifier>...] Sets the number of lines and columns
M in the assembler listing.
For more information, see SH-4 Asse
mbler FORM Directive Specifiers.
.HEA .HEADING [<expression>[,<expression>...]] Sets the header for the source progra
DIN m listing.
G
.SPA .SPACE[ <line count>] Outputs blank lines to the source prog
CE ram listing.
The assembler gives priority to command line option specifications concerning assembler-listing output.
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
n/a DEF NODEF Definition Macro definition statements, .AREPEAT, .AWHILE, .ASSIGNA, and .ASSIG
NC.
n/a CALL NOCALL Call Macro call statements, .AIF, and .AENDI.
n/a EXP NOEXP Expansion Macro expansion statements, .AREPEAT, and .AWHILE.
3 CODE NOCODE Object code lines The object code lines exceeding the source statement lines.
The specification of the .LIST directive is only valid when an assembler listing is output.
See Also
Reference
SH-4 Assembler Listing Directives
Smart Device Development
COL=<column count> The specified value is set to the number of columns per line.
See Also
Reference
SH-4 Assembler Listing Directives
Smart Device Development
.RA .RADIX <radix specifier> Sets the radix, or base, for integer constants with no radix specification.
DIX
Unless otherwise specified, integer constants are assumed decimal numbers.
.IN .INCLUDE <file name> Includes the specified file in the current assembly.
CL
UD The file name can include the directory.
E If the file is not found in the current directory and is not specified with an abso
lute path, the assembler looks in each of the directories specified in the INCLU
DE environment variable.
Q (or q) Octal
O (or o) Octal
H (or h) Hexadecimal
X (or x) Hexadecimal
See Also
Other Resources
SH-4 Assembler Directives
Smart Device Development
2 FATAL Too many errors (%d) - The maximum number of errors was exceeded. The maximum number of errors can be co
- stopping assembly ntrolled using the -maxerrors command line option.
3 FATAL %s not yet implemente If this message appears, a source program has attempted to use a technology that is not y
d et implemented in the assembler. Please report the exact message.
10 ERROR No input files were spe After parsing all of the command line options, the assembler has no input files that it was
cified -- nothing to do able to find and open.
21 ERROR Error reading file: %s Indicates that the assembler was suddenly unable to continue reading input from a file th
at it successfully opened.
30 ERROR Unknown command lin A command line option was specified that the assembler does not recognize or support.
e switch "%s"
31 ERROR Syntax error in comma A recognized command line option was specified incorrectly.
nd line switch "%s": %s
32 ERROR An argument is require An argument was not supplied for a command line option that requires one.
d for %s
33 ERROR A numeric argument is An argument was not supplied or a non-numeric argument was supplied for a command
required for %s line option that requires a numeric argument.
34 ERROR %s is out of range; mus A numeric argument was specified that is not within the valid range. The error message w
t be >= %d and <= %d ill show the valid range for the argument.
35 ERROR Invalid -show/-noshow The assembler could not parse some part of a -show or -noshow command line option.
option list: "%s"
36 WARN Ignoring unimplement A command line option or assembler directive was used that specifies a technology that i
ed option "%s" s not currently implemented in the assembler.
37 WARN Interpreting option "%s A command line option was specified in a way that could be interpreted in more than one
" as "%s" way by the assembler.
This message tells which way the assembler chose to interpret the option.
For instance, -DEBUG could mean the -D option with the argument EBUG (meaning to def
ine EBUG as 1) or it could mean the switch -debug (enabling output of debugging inform
ation).
This particular case could be avoided by using debug (or -DEBUG=1 for an EBUG equate).
40 FATAL Insufficient memory%s The assembler was unable to allocate memory for some purpose.
41 FATAL Insufficient memory; ca The assembler was unable to allocate memory for some purpose.
nnot allocate %u more
%s
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
71 ERROR Nonascii character (^% The assembler encountered a character that it did not expect to see in a source file.
c) in source
72 ERROR Nonascii character (0x The assembler encountered a character that it did not expect to see in a source file.
%02d) in source
73 ERROR What do you mean by " The assembler encountered a combination of characters that it does not understand.
%s"?
74 ERROR "%c" is not a valid radix A radix specifier was used that the assembler does not recognize. Use one of H, D, Q, B, X,
specifier (use HDQBXO O, h, d, q, b, x, or o.
)
75 ERROR "%s" is not a valid radix A radix specifier was used that the assembler does not recognize. Use one of the following:
specifier (use HDQBXO H, D, Q, B, X, O, h, d, q, b, x, or o.
)
76 ERROR Overflow in numeric co A numeric constant was written that cannot be represented in 32 bits. The valid range is -2,
nstant 147,483,648 to 4,294,967,295 or H'00000000 to H'FFFFFFFF.
77 ERROR A backquoted symbol n A backquote character was written (`), which can be used to enclose a symbol whose name
ame cannot span multi contains characters that are not ordinarily allowed, but no matching backquote character w
ple lines as found on the same line.
These characters must come in pairs with a symbol name between them.
78 ERROR A backquoted symbol n Two adjacent backquote characters (``) were written, which would represent a symbol who
ame cannot be null (``) se name is null (zero-length), but such a symbol name is illegal.
The assembler will also issue this error message if a backquote (`) was written as the last c
haracter on a line.
80 ERROR Parser error: %s If this message appears, there is a bug in the assembler because it should recover from the
error and issue a more helpful error message.
Please report the exact message, and if possible, provide a source file that causes the asse
mbler to issue the message.
81 ERROR Failed to parse input If this message appears, there is a bug in the assembler because it should recover from the
error and issue a more helpful error message).
Please report the exact message, and if possible, provide a source file that causes the asse
mbler to issue the message.
101 ERRO Syntax error Something is syntactically invalid on the line for which this error is reported.
R
150 ERRO Cannot put a %s instru An instruction was placed in a delay slot that is not allowed in a delay slot.
R ction in a delay slot
151 ERRO Cannot compute PC dis The assembler is not able to compute the PC displacement for a PC-relative addressing mo
R placement in a delay sl de in a delay slot because such a displacement must be relative to the PC of the branch tar
ot get.
152 ERRO Cannot use "%s #x" in s A MOV.L #imm,Rn cannot be used in a section whose alignment is less than 4, nor a MOV.
R ection (%s) with align < W #imm,Rn in a section whose alignment is less than 2.
%d
153 ERRO Instruction at odd addr An instruction at an odd address is not permitted. Attempting to execute it will cause a pro
R ess cessor exception at run time.
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
202 ERRO Illegal symbol "%s" User-defined symbols are not permitted to begin with \& or . (a period).
R
203 ERRO Illegal label symbol " User defined symbols are not permitted to begin with \& or . (a period).
R %s"
205 WAR %s has already been A symbol was declared or defined that has already been declared or defined.
N declared %s
206 ERRO %s has already been A symbol was declared or defined that has already been declared or defined.
R declared %s
207 ERRO Preprocessor symbo A preprocessor symbol was used before defining it.
R l "%s" has not been
defined yet
210 ERRO A string ("%s") is not A string constant or a string-valued symbol or expression was used in a context in which strin
R valid here gs, including character constants, are not supported.
211 ERRO Cannot %s a %s sym A symbol that cannot be imported or exported (one defined using .ASSIGN, .ASSIGNA, .ASSIG
R bol (%s) NC, .REG, or .SECTION, or an internal register symbol) was used in an .EXPORT or .GLOBAL ass
embler directive.
212 ERRO Symbol "%s" has not A symbol was referenced in a context where forward references are not permitted, but the sy
R been defined yet mbol has not yet been defined, or its value is not yet known.
213 ERRO The value of symbol A symbol was referenced in a context where forward references are not permitted, but the sy
R "%s" is not known y mbol has not yet been defined, or its value is not yet known.
et
214 ERRO "%s" is an .IMPORT s An .IMPORT symbol was used in a context where external references are not permitted.
R ymbol; its value is u
nknown
301 ERRO Too many operands; Too many operands were supplied for an instruction or an assembler directive.
R expecting %s
302 ERRO "%s" is not an opcod An operation name was specified that is not an opcode or directive, nor a defined macro. Chec
R e, directive, or macro k the spelling, or if it is a macro, make sure it has been defined before the first use.
304 ERRO Not enough operan Fewer operands were supplied than are required for an instruction or an assembler directive.
R ds; expecting %s
307 ERRO This addressing mod An addressing mode was specified that is not legal for the instruction or the instruction/modifi
R e is not legal here er combination, or a modifier was specified that is not legal for the instruction.
308 ERRO Invalid addressing m A combination of addressing modes was specified that is not legal for the instruction or the in
R ode (incompatible o struction/modifier combination, or a modifier was specified that is not legal for the combinati
perands) on of addressing modes and the instruction.
309 ERRO Invalid addressing m A register name was specified in a place where that register (or register type) is not legal.
R ode (illegal register
%s): "%s"
310 ERRO Cannot use %s here; A register other than r0 was specified in a context where only r0 is legal.
R only r0 is valid
311 ERRO "%s" (%s) is not a re The symbol specified as the operand of a .REG directive is not a valid register name.
R gister
312 ERRO This would require An operation was attempted that cannot be represented in the MS-COFF object format as curr
R %s relocation ently defined.
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
402 ERR %d (0x%x) is out of An operand value is outside of the legal range.
OR range; must be >=
%d and <= %u The message tells you what the valid range is.
This message can also be issued when an attempt is made to use a PC-relative operation (such a
s a branch, or a MOV @(disp, PC),Rn) to refer a location that is too far away, or that is a backwar
d reference for an instruction that can only support forward references.
403 ERR Cannot %s when o Only certain arithmetic operations are supported on relative values.
OR ne or more operan
ds are relocated
404 ERR Relocated value not A relative value or relative-valued symbol or expression was used in a context where only absolu
OR valid here; must be te values are allowed.
absolute
405 ERR Cannot %s import s Only certain arithmetic operations are supported on relative values and external symbols.
OR ymbols or between
sections
406 ERR Cannot %s expr w/ Only certain arithmetic operations are supported on relative values and external symbols.
OR %d reloc%s and ex
pr w/%d reloc%s
413 ERR Unknown relational The only supported relational operators besides the regular C operators are EQ, NE, GT, LT, GE, a
OR operator: "%s" nd LE, regardless of case.
420 ERR Syntax error in ope The assembler cannot recognize an operand of an instruction.
OR rand
421 ERR Syntax error in expr The assembler cannot recognize an expression.
OR ession
422 ERR Cannot use a %s sy An attempt was made to use a register in an expression.
OR mbol here
This is permitted only in a few specific situations.
423 ERR Expression must be An instruction was written like MOV symbol,Rn or MOVA symbol,Rn where symbol is an absolut
OR relative (or use #im e symbol (such as a .EQU symbol might be).
mediate)
To move the value of the symbol into the register, use MOV #symbol,Rn.
424 ERR The "%s" operator ( An operator was used that is recognized but not supported, such as ++ or --.
OR %s) is not supporte
d
425 ERR Expression result o An arithmetic operation resulted in overflow (loss of important bits).
OR verflow: %s %d (0x
%x)
426 ERR Expression result o An arithmetic operation resulted in overflow (loss of important bits).
OR verflow: %d (0x%x)
%s %d (0x%x)
427 ERR Expression result o An arithmetic operation resulted in overflow (loss of important bits).
OR verflow: %s %u (0x
%x)
453 ERR %s needs a literal p The source line noted in the text of the message (where the %s is above) contains a literal pool re
OR ool before here ference that cannot reach as far as the address of the source line noted at the beginning of the er
ror message line.
Insert a .POOL directive or an unconditional branch somewhere between the two source lines.
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
501 ERRO Illegal value for .ORG%s An .ORG directive was used to move the location counter backward to a lower address th
R an its current value or more than 1 MB forward.
If the intent was to move the location counter forward by more than 1 MB, consider that t
his would occupy that amount of space in the object file, due to the MS-COFF object file f
ormat.
Another approach may be best.
503 ERRO Exported symbol "%s" n The symbol named in the message was declared in a .EXPORT directive, but was not defin
R ot defined ed anywhere in the source file.
516 ERRO This %s directive conflict An operand of a .PRINT directive conflicts with an operand of a previous .PRINT directive,
R s with a previous %s or an operand of an .OUTPUT directive conflicts with an operand of a previous .OUTPUT d
irective.
517 ERRO The result of this express An expression was supplied whose value is not yet defined in a context where the value
R ion is not known yet must be known on the assembler's first pass through the file.
519 ERRO String is %u characters l The string(s) supplied for a .SDATAC or .SDATACB directive must be no more than 255 ch
R ong; maximum is 255 aracters long, because the length is represented in a single byte.
520 ERRO A string or string express A numeric constant or a numeric-valued symbol or expression was supplied in a context
R ion is required %s where a string is required.
521 WAR A literal pool would neve A .NOPOOL directive was put in a place where the assembler would not have generated a
N r be put here anyway literal pool anyway.
522 WAR .POOL illegal in delay slo A literal pool wound up after a delayed branch instruction; the assembler automatically s
N t of %s upplies a NOP instruction to fill the delay slot.
531 ERRO Invalid section type "%s" An invalid section type was specified The valid section types are CODE, DATA, DUMMY, a
R nd BSS, without regard to case.
532 ERRO Section type (%s) must f The section type cannot be specified before the section name.
R ollow section name (%s)
533 ERRO Section type (%s) cannot A value cannot be specified for the section type.
R have a value
534 ERRO Invalid option "%s" A keyword option was supplied for a directive for which it is not valid.
R
535 ERRO Option "%s" cannot have A value was supplied for an option that cannot have a value.
R a value
536 ERRO Option "%s" must have a A value was not supplied, or a non-numeric value was supplied, for an option that require
R numeric value s a numeric value.
537 ERRO Alignment must be a po See the .ALIGN directive.
R wer of 2 between 1 and
8192.
538 ERRO "%s": MS-COFF doesn't s This message only occurs if an attempt is made to use a particular technology provided b
R upport absolute sections y other Renesas assemblers that is not supported in this assembler due to restrictions of t
he MS-COFF object format.
539 ERRO "%s": MS-COFF Cannot e Only relative values may be exported; absolute symbols cannot be exported.
R xport non-relocatable .E
QU's
540 ERRO "%s": MS-COFF Cannot e Symbols defined in a section of type DUMMY cannot be exported.
R xport syms from DUMM
Y section
541 ERRO Illegal alignment %u; mu An alignment value must be a power of two (2^0 through 2^6).
R st be a power of two
542 ERRO Block count too large (m A block count was specified that would result in more than 4 GB of data.
R ax %u) -- directive ignor
ed
543 ERRO Cannot export "%s"; its v An .EQU symbol was exported whose value is dependent on an external (.IMPORT) symbo
R alue depends on "%s" l.
544 WAR Code not in function; nee All code should appear between an .ENTRY directive and an .ENDF directive.
N d a .ENTRY
545 WAR Missing .PROLOG betwe Each function (.ENTRY and .ENDF pair) should have a .PROLOG directive inside it somewh
N en .ENTRY/.ENDF for "%s ere.
"
546 WAR Missing .ENDF; closing f All code should appear between a .ENTRY directive and a .ENDF directive.
N unction "%s"
547 ERRO No matching .ENTRY for The assembler encountered a .ENDF directive that does not seem to have a matching .EN
R .ENDF TRY directive.
548 ERRO No active .ENTRY for .PR The assembler encountered a .PROLOG directive when there is no .ENTRY directive active
R OLOG (that is, not yet terminated by a .ENDF directive).
549 ERRO .PROLOG already specifi A .PROLOG directive was specified more than once in a single function (.ENTRY and .END
R ed for function "%s" F pair).
550 WAR .END encountered; ignori A .END directive was encountered in a file that was not the last file specified on the comm
N ng files starting with %s and line.
The rest of the files specified on the command line will be ignored.
551 ERRO .SECTION ASSOC= must The ASSOC option of the .SECTION directive must have a value that is a section name (inc
R be followed by a section luding a COMDAT style section name, such as ".text{_main}").
name
552 ERRO Section "%s" must be CO Either the section being declared with the current .SECTION directive or the target of an A
R MDAT to allow option " SSOC= option of the current .SECTION directive is not a COMDAT style section.
%s"
553 ERRO .PDATA is illegal betwee It is no longer valid to specify a .PDATA directive after a .ENTRY directive and before a .EN
R n .ENTRY and .ENDF DF directive; the .PDATA directive must now be specified before the .ENTRY to which it sh
ould apply.
554 ERRO Prolog is too long (%u, The .BIGENTRY directive must be used in place of the .ENTRY directive for a function who
R max %u); use .BIGENTRY se prolog is more than 510 bytes long.
555 ERRO Function is too long (%u, The .BIGENTRY directive must be used in place of the .ENTRY directive for a function that i
R max %u); use .BIGENTRY s more than 16,777,214 bytes long.
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
612 ERROR Syntax error in macro na The assembler encountered something that does not look like a symbol name immedia
me for .MACRO tely following a .MACRO directive.
619 ERROR Invalid macro parameter A macro parameter name was specified that begins with a number. This is not permitte
name "%s" d.
622 ERROR No matching paren for m The assembler was not able to find a ) to match a \( which it encountered in a macro ex
acro expansion exclusion pansion.
The macro expansion exclusion syntax \( ... ) is not allowed to start on one line and end
on another line; it must all occur on a single line of the macro.
624 ERROR Too many macro parame The macro used has too many parameters (operands).
ters (max %d)
631 ERROR %s without matching %s The .AENDI or .AENDR or .AENDW given does not seem to have a matching .AIF, .AREPE
AT, or .AWHILE.
This error also appears if one of these constructs is nested inside another, and the end
directive for the inner one is omitted.
632 ERROR Cannot have %s after .AE An .AELSIF or an .AELSE cannot be put after an .AELSE in the same .AIF block.
LSE
633 ERROR %s still active at end of " An .AIF, .AREPEAT, .AWHILE, or .MACRO (macro definition) was still in progress when th
%s" macro expansion e end of a macro was reached.
These constructs cannot span macro boundaries.
634 ERROR %s from line %d still acti An .AIF, .AREPEAT, .AWHILE, or .MACRO (macro definition) was still in progress when th
ve at end of file %s e end of a file was reached.
These constructs cannot span file boundaries.
635 ERROR .EXITM outside of any .AR The assembler encountered an .EXITM directive that seems to be stranded without any l
EPEAT, .AWHILE, or macr oop or macro to exit from.
o
This message might also be issued if a previous error caused the assembler to ignore t
he beginning of such a construct.
636 ERROR .END with %s still active The assembler encountered an .END directive while an .AIF, .AREPEAT, .AWHILE, or mac
ro expansion was still in progress. The assembler ignores the .END directive in this case.
670 ERROR This syntax is only legal i A special facility was used that is only available when a macro is being expanded, for ex
n a macro: "%s" ample, in a macro body).
671 ERROR Syntax error in macro ar The assembler was unable to parse one or more of the arguments to a macro.
guments
It tries to continue as best it can.
672 ERROR End of file reached while An .AIF, .AREPEAT, .AWHILE, or .MACRO (macro definition) was still in progress when th
processing %s e end of a file was reached.
These constructs cannot span file boundaries.
Error 634 is more expected than this one.
673 ERROR Unknown macro parame A macro parameter name was referenced that is not defined for the macro currently be
ter name "%s" ing expanded.
In the case of nested macro expansion, only the arguments of the innermost active mac
ro are accessible.
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
802 ERRO Symbol %s already d A symbol was redeclared or redefined that has already been declared or defined.
R efined as a %s
807 WAR Invalid size specificati An illegal size specification (modifier) was supplied. The only legal modifiers are B, W, L, b, w,
N on "%c" and l (lowercase L).
808 WAR A size specification (" A size specification (modifier) was supplied for an instruction or directive that cannot have o
N %c") is not allowed h ne.
ere
810 WAR Too many operands; More operands were supplied than can be used by the instruction or directive.
N expecting %s
811 WAR Label not allowed her A label was supplied on a directive that cannot have one. The label is ignored, and will not be
N e; ignoring "%s" defined. This can lead to further error messages.
813 WAR Section "%s" has alre The type or attributes of a section cannot be changed after the first time it is declared (by usi
N ady been declared %s ng the .SECTION directive).
816 WAR Unaligned %s size dat A .DATA or .RES or related directive was written that is attempting to place a word at an odd
N a at 0x%x address or a longword at an address that is not a multiple of 4.
Be careful. Attempting to access such data in a single instruction causes a processor exceptio
n.
817 WAR Beware of possibly u An alignment was specified of less than 2 in a code section.
N naligned code
This can result in code being placed at an odd address.
An attempt to execute code at an odd address causes a processor exception.
818 WAR Cannot guarantee ali A value was specified for an .ALIGN directive that is greater than the alignment of the current
N gn > section "%s"'s al section. Such an alignment cannot be guaranteed.
ign (%d)
826 WAR Instructions valid onl An executable or extended instruction was written in a section that is not a CODE section. Thi
N y in Code section; "%s s is not permitted.
" is %s
827 WAR %s invalid in a %s sec Uninitialized data was reserved in a CODE section, or initialized data in a DUMMY or BSS sect
N tion (%s) -- ignored ion. This is not permitted.
838 ERRO A character string ma This message generally indicates a missing closing quote or the presence of an embedded q
R y not span multiple li uote in the string that was not doubled.
nes
839 WAR You may not specify A value was specified for a keyword option that cannot have a value.
N a value for %s; it is ig
nored
840 WAR Block count is zero -- A .RESB or .DATAB or .SDATAB directive was written with a zero block count. This effectively
N directive ignored nullifies the directive.
841 WAR %u is too large to fit i A control character expression resulted in a value greater than 255.
N n a character; using %
u
842 WAR "%s" is abs; expr is loc When a branch refers to a symbol in an absolute section, the symbol is assumed to represent
N ation, not displaceme a location, not a displacement. Absolute sections are not supported.
nt
851 WAR Overriding %s from . A .PDATA directive has overridden a previous .PDATA directive.
N PDATA %s
This can only happen if two .PDATA directives are written in the same section without a valid
.ENDF between them.
852 WAR %s from .PDATA at % A .PDATA directive was written that did not have a valid .ENDF following it in the same sectio
N s(%d) was never used n.
870 WAR Unaligned displacem A displacement value that refers to a word was an odd number, or a displacement value that
N ent value %d; truncati refers to a longword was not a multiple of 4.
ng to %d
The stray least significant bits are dropped on the floor.
871 WAR PC-relative in delay sl When a PC-relative instruction is written in a delay slot, the PC that it is relative to is the PC o
N ot is branch-dest relat f the branch destination
ive
876 WAR Inserted BRA and NO The assembler automatically inserted a BRA to skip over a literal pool (and a NOP to fill the B
N P before literal pool RA's delay slot) because it observed that the literal pool did not follow the delay slot instructi
on of an unconditional branch.
880 WAR Function end after del The assembler encountered an .ENDF directive (or the end of the input file or section) with a
N ayed branch branch's delay slot still unfilled.
The assembler supplies a NOP to fill the delay slot.
886 WAR .END missing -- prete The assembler reached the end of the input without seeing an .END directive.
N nding there was one
887 WAR .END reached -- ignor The assembler encountered an .END directive but noticed that there was something more th
N ing to EOF an blank lines after it.
Whatever it was, the assembler ignored it.
888 WAR Entry point not suppo The .END directive may not have an operand.
N rted
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
904 ERROR %s: %s There was some problem opening or writing to the object file.
907 ERROR Cannot allocate %u bytes of me Probably as a result of a .ORG directive, the assembler is unable to allocate en
mory for section "%s" ough memory to store the data for the section named.
It will try to continue the assembly, if possible.
998 ERROR %s This message occurs when an .AERROR or .ERROR directive is assembled.
See Also
Other Resources
Renesas SH-4 Series Assembler
Smart Device Development
Function MIPS 16 ASE MIPS II ISA MIPS II ISA FP unit MIPS IV ISA FP unit
__emul Y Y Y Y
__emulu Y Y Y Y
__ll_lshift Y Y Y Y
__ll_rshift Y Y Y Y
__ull_rshift Y Y Y Y
_enable Y Y Y Y
_disable Y Y Y Y
__regsize Y Y Y Y
_InterlockedDecrement Y Y Y Y
_InterlockedExchangeAdd Y Y Y Y
_InterlockedCompareExchange Y Y Y Y
_InterlockedIncrement Y Y Y Y
_InterlockedExchange Y Y Y Y
See Also
Other Resources
Run-Time Library Reference
Smart Device Development
__emul
__emul
This function multiplies a 32-bit value in register RT times a 32-bit value in register RS, and obtains a 64-bit result.
Parameters
int1
[in] Value in RT the first term in the multiplication.
int2
[in] Value in RS, the second term in the multiplication.
Return Values
Result of binary arithmetic.
Remarks
The compiler translates this function into the mult instruction.
Requirements
Routine Required header Architecture
__emul <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
__emulu
__emulu
This function multiplies a 32-bit unsigned value in register RT times a 32-bit unsigned value in register RS, and obtains a 64-
bit result.
Parameters
int1
[in] Value in RT, the first term in the multiplication.
int2
__ll_lshift
__ll_lshift
This function shifts a 64-bit word to the left a specified number of bits.
Parameters
int64
[in] The value to shift.
int
[in] The number of bits to shift.
Return Values
None.
Remarks
The compiler translates this function into the SLL instruction.
Requirements
Routine Required header Architecture
__ll_lshift <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
__ll_rshift
__ll_rshift
This function shifts a 64-bit word to the right a specified number of bits.
Parameters
int64
[in] The value to shift.
int
[in] The number of bits to shift.
Return Values
None.
Remarks
The compiler translates this function into the SRL instruction.
Requirements
Routine Required header Architecture
__ll_rshift <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
__regsize
__regsize
This function returns the register size.
Parameters
None.
Return Values
The size of the target register.
Requirements
Routine Required header Architecture
__regsize <stdlib.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
__ull_rshift
__ull_rshift
This function shifts a 64-bit unsigned word to the right a specified number of bits.
Parameters
unsigned_int64
[in] The value to shift.
int
[in] The number of bits to shift.
Return Values
None.
Remarks
The compiler translates this function into the SRA instruction.
Requirements
Routine Required header Architecture
__ull_rshift <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
_enable
_enable
This function enables MIPS16 ASE.
void _enable(void);
Parameters
None.
Return Values
None.
Requirements
Routine Required header Architecture
_enable <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
_disable
_disable
This function disables MIPS16 ASE.
void _disable(void);
Parameters
None.
Return Values
None.
Requirements
Routine Required header Architecture
_disable <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
_InterlockedCompareExchange
_InterlockedCompareExchange
This function atomically compares a variable value to a comparison value and exchanges the value of Destination with
Exchange if they are the same.
The function prevents more than one thread from using the same variable simultaneously.
InterlockedCompareExchange(
PVOID* Destination,
PVOID ExChange,
PVOID Comperand
);
Parameters
Destination
[out] Pointer to the value that the function compares to Comperand.
ExChange
[in] Value used to replace contents of Destination, if necessary.
Comperand
[in] Standard value used for comparison to the value in Destination.
Return Values
Initial value of the variable pointed to by Destination.
Remarks
The interlocked functions provide a simple mechanism for synchronizing access to a variable that is shared by multiple
threads. The threads of different processes can use this mechanism if the variable is in shared memory.
Requirements
Routine Required header Architecture
_InterlockedCompareExchange <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
_InterlockedDecrement
_InterlockedDecrement
This function performs an atomic addition of a decrement value to an addend variable. The function prevents more than one
thread from using the same variable simultaneously.
InterlockedDecrement(
PLONG Addend
);
Parameters
Addend
[in] Value to be decremented.
Return Values
Result of binary arithmetic.
Remarks
The interlocked functions provide a simple mechanism for synchronizing access to a variable that is shared by multiple
threads. The threads of different processes can use this mechanism if the variable is in shared memory.
Requirements
Routine Required header Architecture
_InterlockedDecrement <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
_InterlockedExchangeAdd
_InterlockedExchangeAdd
This function performs an atomic addition of an increment value to an addend variable. The function prevents more than one
thread from using the same variable simultaneously.
InterlockedExchangeAdd(
PLONG Addend,
LONG Increment
);
Parameters
Addend
[in, out] Value to be incremented.
Increment
_InterlockedIncrement
_InterlockedIncrement
This function performs an atomic addition of an increment value to an addend variable. The function prevents more than one
thread from using the same variable simultaneously
InterlockedIncrement(
PLONG Addend
);
Parameters
Addend
[in] Value to be incremented.
Return Values
None.
Remarks
The interlocked functions provide a simple mechanism for synchronizing access to a variable that is shared by multiple
threads.
The threads of different processes can use this mechanism if the variable is in shared memory.
Requirements
Routine Required header Architecture
_interlockedIncrement <winnt.h> MIPS16, MIPSII, MIPSIII, MIPS IV, MIPS 32
See Also
Reference
Intrinsic Functions for MIPS Microprocessors
Smart Device Development
_InterlockedExchange
_InterlockedExchange
This function atomically exchanges a pair of 32-bit values. The function prevents more than one thread from using the same
variable simultaneously.
LONG InterlockedExchange(
LONG volatile* Target,
LONG Value
);
Parameters
Target
[in, out] Pointer to the value to be exchanged. The function sets this variable to Value, and returns its prior value.
Value
/QMFPE - Floating Point Emula Enables floating-point emulation, using floating-point hardware.
tion
/QMRnnnn - Optimize for Spec Enables chip-specific inline assembler for Phillips PR3900, NEC VR4100, NEC VR4200. and NE
ific MIPS chip C VR4300, and generates code for corresponding MIPS ISA.
See Also
Other Resources
MIPS Calling Sequence Specification
Smart Device Development
/QM Causes the compiler to generate instructions Default when /QMmips3, /QMmips4, /QMmips5, or /QMmips64 optio
FPE - for a floating-point hardware unit. n specified.
See Also
Reference
/QMmipsNN - Generate Code for Specific MIPS ISA
Other Resources
MIPS Calling Sequence Specification
Smart Device Development
/QMmips2 Generates code for the MIPS II instruction set. /QMFPE is default.
These switches and the /QMmips16 - Generate Code for MIPS16 ASE switch are mutually exclusive.
See Also
Other Resources
MIPS Calling Sequence Specification
Smart Device Development
MIPS Registers
MIPS Registers
The MIPS microprocessor has 32 general-purpose registers.
Registers are 32 bits for MIPS I instruction set architecture (ISA) and II ISA.
MIPS III and higher ISAs have 32-bit registers when running in 32-bit mode, and 64-bit registers when running in 64-bit
mode.
Registers $1, $26, $27, $29 are reserved for special purposes by the assembler, compiler and operating system.
Register $0 is hard wired to the value zero, and $31 is the link register for jump and link instructions but can be used
with other instructions with caution.
The following table summarizes the usage convention for these registers.
Regis Comm Description
ter N on Na
ame me
$0 zero Always has the value 0. Any writes to this register are ignored.
$1 at Assembler temporary.
$4-$7 a0-a3 Function argument registers that hold the first four words of integer type arguments.
Functions use these registers to hold floating-point arguments.
When floating-point hardware is not present, or compiler options enable floating-point emulation, functions us
e a0 to hold the first single precision floating-point argument and a1 to hold the second single precision floatin
g-point argument.
Functions use a0-a1 for the first double precision floating-point argument, and a2-a3 to hold the second doubl
e precision floating-point argument.
Not preserved across function calls.
$8-$1 t0-t9 Temporary registers you can use as you want. Not preserved across function calls.
5,
$24-$
25
$26-$ k0-k1 Reserved for use by the operating system kernel and for exception return.
27
$28 gp Global pointer.
Not used in Windows CE and may be used as save register for called functions.
$31 ra Return address register, saved by the calling function. Available for use after saving.
$f0 n/a Function return register used to return float and double values from function calls.
($f12, n/a Two pairs of registers used to pass float and double valued parameters to functions.
$f13)
Pairs of registers are parenthesized because they have to pass double values.
and
To pass float values, only $f12 and $f14 are used.
($f14,
$f15)
MIPS Prolog
MIPS Prolog
The MIPS prolog has several immediately contiguous parts, regardless of whether MIPS 16-bit mode, MIPS 32-bit mode, or
MIPS 64-bit mode is in force.
The following steps show the required elements of a MIPS prolog.
The code examples shown apply to MIPSII. For MIPS IV, replace the sw instruction with sd, and replace the lw instruction with
ld.
1. Define the prolog and set up the entry.
.ent <routine_name>
<routine_name>:
An extended addiu instruction of four bytes is generated for frame sizes greater than 1024.
If the frame size exceeds 32768, update the stack pointer with a constant from the literal pool using the following
sequence of instructions.
hw $3, <frame size> constant offset(pc)
move $2, $29
subu $2, $2, $3
move $29, $2
The size of the stack frame must be a multiple of eight. This includes space for local variables and temporaries, saved
registers, and a procedure call argument area for non-leaf routines.
Any routine that uses registers $16-$23, or $30, or any floating-point register that the called function saves, must save
these registers.
The procedure call argument area contains the maximum number of bytes required for the arguments of any procedure
called in a non-leaf routine. This number of required bytes includes those arguments that the function can pass in
registers, unless the N32 calling convention is in use.
3. Set up a virtual frame pointer. The virtual frame pointer is sp($29) added to the frame size.
.frame framereg (usually $29), framesize, returnreg (usually $31)
4. Set a bit in the bitmask for each general-purpose register saved. Set bits in little endian order. The frame offset is the
offset, a negative number, from the virtual frame pointer where the register save area begins.
.mask mask, <frame offset>
If subsequent lower number registers need to be saved, the offset depends on the MIPS mode. If the next register is a
MIPS16 register,
sw $<mips16 register>, <frame size> + <frame offset> - n(sp)
Otherwise
move $2, <mipsii register>
sw $2, <frame size> + <frame offset> - n(sp)
Where N is four and is incremented by four for each subsequent lower number register to be saved.
If the <frame size> + <frame offset> is greater than 32767, then the following 3 instruction sequence is required before
executing the register save loop:
lw $2, <frame size> + <frame offset>constant offset(pc)
move $2, $29
addu $3, $2, $3
The sw instructions depend on the mode of the MIPS register. If the next register is a MIPS16 register:
sw $<mips16 register>, -n($3)
Otherwise
move $2,$<mipsii register>
sw $2, -n($3)
See Also
Reference
MIPS Assembler Macros
Other Resources
MIPS Prolog and Epilog
Smart Device Development
MIPS Epilog
MIPS Epilog
While each procedure has only one prolog, a procedure may contain any number of epilogs if the procedure uses multiple exit
points. Each epilog is required to have certain specific parts. All parts are contiguous with no intervening instructions.
The following steps shows how to restore the registers saved by the called function for a MIPS ISA. For MIPS IV, replace the lw
instruction with ld.
Note that MIPS16 epilogs employ slightly different guidelines to restore the registers saved by the called function.
1. Issue a restore for each register saved in the prologue
lw $31, framesize+frameoffset($29) ; restore return addresslw reg, framesize+fram
eoffset-N($29) ; restore integer register
ldc1 reg, framesize+frameoffset-N($29) ; restore float register
Where N is four and incremented by four for each subsequent lower number register saved.
2. Return from the procedure.
j $31
The minimum proper epilog for a leaf routine includes the return jump and the .end. Additionally, for a nonleaf routine,
loading register $31 is required.
jr scratch
See Also
Reference
MIPS Assembler Macros
Other Resources
MIPS Prolog and Epilog
Smart Device Development
EXCEPTION_HANDLER (MIPS Associates a named exception handler with the subsequent NESTED_ENTRY
)
LEAF_ENTRY (MIPS) Declares the beginning of a routine that does not require any prolog code
NESTED_ENTRY (MIPS) Declares the beginning of a routine that has an existing stack frame or creates a new stack fram
e
ALTERNATE_ENTRY (MIPS)
ALTERNATE_ENTRY (MIPS)
This macro declares an alternate entry to a routine of type NESTED_ENTRY (MIPS) or LEAF_ENTRY (MIPS).
ALTERNATE_ENTRY Name[,
[Section=]SectionName]
Parameters
Name
Name is the entry point and is in the global name space.
SectionName
SectionName is the name of the section in which the entry will appear; see Remarks.
Return Values
None.
Remarks
The ALTERNATE_ENTRY macro does not use the SectionName parameter. The parameter is accepted and ignored for
consistency with NESTED_ENTRY (MIPS) and LEAF_ENTRY (MIPS). If used, an ALTERNATE_ENTRY call must appear in the
body of a routine.
See Also
Reference
NESTED_ENTRY (MIPS)
LEAF_ENTRY (MIPS)
Smart Device Development
EXCEPTION_HANDLER (MIPS)
EXCEPTION_HANDLER (MIPS)
This macro associates an exception handler Handler with a subsequent NESTED_ENTRY (MIPS) or LEAF_ENTRY (MIPS).
EXCEPTION_HANDLER Handler
Parameters
Handler
Name of exception handler.
Return Values
None.
See Also
Reference
NESTED_ENTRY (MIPS)
LEAF_ENTRY (MIPS)
Smart Device Development
LEAF_ENTRY (MIPS)
LEAF_ENTRY (MIPS)
This macro declares the beginning of a routine that does not require any prolog code.
LEAF_ENTRY Name[,[Section=]SectionName]
Parameters
Name
Name is the routine name and is in the global name space.
SectionName
SectionName is the name of the section in which the entry will appear; it is optional and defaults to .text.
Return Values
None.
Remarks
A LEAF_ENTRY must have an associated PROLOGUE_END.
See Also
Reference
NESTED_ENTRY (MIPS)
EXCEPTION_HANDLER (MIPS)
PROLOGUE_END
Smart Device Development
NESTED_ENTRY (MIPS)
NESTED_ENTRY (MIPS)
This macro declares the beginning of a routine that has an existing frame or that creates a stack frame.
NESTED_ENTRY Name[,[Section=]SectionName]
Parameters
Name
Name is the routine name and is in the global name space.
SectionName
SectionName is the name of the section in which the entry will appear; it is optional and defaults to. text.
Return Values
None.
Remarks
A NESTED_ENTRY must have an associated PROLOGUE_END.
See Also
Reference
LEAF_ENTRY (MIPS)
EXCEPTION_HANDLER (MIPS)
PROLOGUE_END
Smart Device Development
PROLOGUE_END
PROLOGUE_END
This macro marks the end of the prolog area for the MIPS microprocessor family.
PROLOGUE_END
Parameters
None.
Return Values
None.
Remarks
This macro must appear following a NESTED_ENTRY (MIPS) or LEAF_ENTRY (MIPS) macro.
See Also
Reference
NESTED_ENTRY (MIPS)
LEAF_ENTRY (MIPS)
Smart Device Development
MIPS Assembler
MIPS Assembler
Support for MIPS-licensed microprocessor includes a standalone assembler, inline assembly, and assembler macros.
In This Section
Stand-alone MIPS Assembler
The next code example shows how to assemble an assembly language source file into an object file without linking, using the
"-c" assembler switch.
To see more assembler options, type the following at the command line:
mipsasm /?
See Also
Concepts
MIPS Inline Assembly Language
Other Resources
MIPS Calling Sequence Specification
Smart Device Development
extern "C" {
void _asm (char*,...);
};
#pragma intrinsic (__asm)
Within the string argument of the _asm prototype, an embedded semicolon (;) or newline (\n) is used to separate multiple
assembly language statements. The following example shows how to use a semicolon to signify multiple assembly language
statements.
__asm(".set noat;"
"mult $1, $4, $5; "
".set at ");
Error C2759: inline assember reports function literal used with call optimization
If you want to compile your code with /Og (Global Optimizations), you will need to replace the la pseudo-op with with other
constructions that do not cause a compiler error.
The following code example shows such a replacement.
Replace this code construction
__asm("la v0, f");
See Also
Concepts
MIPS Inline Assembly Language
Smart Device Development
The register macro names are interchangeable with their numeric names using a dollar sign prefix. For example, the following
two statements are equivalent:
See Also
Concepts
_asm Keyword in MIPS Inline Assembly
Smart Device Development
3 FATAL INTERNAL ASSEMBLER ERROR: Insufficient memory (assembler file '%s', line %d)
120 FATAL Product ID mismatch between '%s' version '%ld' and '%s' version '%ld'
508 ERROR Illegal branch-label '%s' reference at line (%d): branch and label are in different sections
522 ERROR Both .cpalias and .cprestore used in the same .ent/.end pair
550 ERROR Too many float literals — compile with \\""-Wb,-nopool\\""
551 ERROR Cannot label a pseudo-op in text section
575 ERROR MIPS16 load with symbolic offset must use different base & dest
576 ERROR MIPS16 store may not use symbolic offset in base-offset mode
587 ERROR 2-register MIPS16 jalr must take $ra as first operand
630 ERROR String within expression may have only one character: %s
9 WAR INTERNAL COMPILER WARNING - Invalid version stamp Please choose the Technical Support command on the Visual
2 N C++ Help menu, or open the Technical Support help file for more information
4
9 WAR Errata 52: DIV in branch delay slot may not work on a R4000 chip
2 N
7
9 WAR Division by zero
2 N
8
9 ERR duplicate public symbol '%s' defined for COMDAT '%s' (-Gy), linked image may not run
7 OR
2
9 WAR duplicate public symbol '%s' defined for COMDAT '%s' (-Gy), linked image may not run
7 N
2
9 War JAL should not use $31 alone or any register twice
8 n
4
9 War Optional argument not S, ignored
8 n
5
9 War Multiply accumulate instruction used without /QMRnnnn - Optimize for Specific MIPS chip, where nnnn = 4121, Viper
9 n , 5400, 32, or 64.
8
See Also
Reference
MIPS Error Messages 1-525
MIPS Error Messages 526-610
MIPS Error Messages 611-660
MIPS Error Messages 661-910
Other Resources
MIPS Family Processors
Desarrollo para Smart Device
Cambiar Abre el cuadro de diálogo Cambiar origen de datos, donde puede seleccionar un origen de datos y un
proveedor de datos.
Botones de opción O Especifica si el origen de datos se encuentra en el equipo de desarrollo o en un dispositivo conectado por
rigen de datos ActiveSync.
Crear Abre el cuadro de diálogo Crear nueva base de datos, donde puede especificar un nombre de archivo y
una contraseña para la nueva base de datos.
Examinar Abre el cuadro de diálogo Seleccionar archivo de base de datos, donde puede seleccionar una base d
e datos de SQL Server Mobile Edition o SQL Server Compact Edition existente.
Avanzadas Abre el cuadro de diálogo Propiedades avanzadas, donde puede modificar el nombre y ruta de acceso
del archivo de base de datos y especificar una contraseña.
Probar conexión Prueba la conexión a la base de datos especificada en el cuadro Base de datos.
Vea también
Otros recursos
Referencia de la interfaz de usuario para dispositivos
Desarrollo para Smart Device
Tipo de servidor
Biblioteca de vínculos dinámicos (DLL)
Especifica que el servidor es una biblioteca de vínculos dinámicos (DLL) y, por tanto, un servidor en proceso.
Ejecutable (EXE)
Especifica que el servidor es un ejecutable (EXE) y, por tanto, un servidor local fuera de proceso. Esta opción no proporciona
compatibilidad con MFC.
Opciones adicionales
Admitir MFC
Especifica que el servidor incluye compatibilidad con MFC. Esta opción vincula el proyecto a las bibliotecas MFC de forma
que pueda tener acceso a cualquiera de las clases y funciones que contienen.
Seleccione esta opción sólo si necesita utilizar clases específicas de MFC en su proyecto. Las clases de utilidad como CString,
CRect Class, CSize Class y CPoint Class no necesitan que se agregue compatibilidad MFC al proyecto ATL en cuestión.
Si elige esta opción, debe agregar la línea siguiente al principio de cada método COM, procedimiento de ventanas y función
exportada que utilice MFC:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Aplicaci Crea la arquitectura de aplicación de la consola para una determinada aplicación. Esta opción sólo está disponible
ón de co para plataformas que admiten aplicaciones de la consola.
nsola
Archivo Crea un archivo binario (DLL) escrito en Visual C o Visual C++ que utiliza llamadas a la API de Windows CE en lug
DLL ar de a las clases MFC. Actúa como una biblioteca de funciones compartida que varias aplicaciones pueden utilizar
simultáneamente. Puede indicar que la DLL exporta símbolos.
Bibliote Crea un archivo que contiene objetos (con sus funciones y datos) que se vincula al programa cuando se genera el
ca estáti archivo ejecutable. Puede vincular una biblioteca estática a un programa basado en MFC o a un programa que no
ca esté basado en MFC. No puede agregar la compatibilidad con ATL a un proyecto de biblioteca estática.
Opciones adicionales
Permite definir las compatibilidades y las opciones de la aplicación, en función de su tipo.
Opció Description
n
Proyec Especifica que los archivos de proyecto están en blanco. Si no tiene un conjunto de archivos de código fuente (como
to vací archivos .cpp, archivos de encabezado, iconos, barras de herramientas o cuadros de diálogo) y desea crear un proye
o cto en el entorno de desarrollo de Visual C++, primero deberá crear un proyecto vacío y después agregar los archiv
os al proyecto. Esta selección no está disponible para proyectos de biblioteca estática.
Vea también
Referencia
Asistente para proyectos Win32 para Smart Device
Desarrollo para Smart Device
Basada en c Crea una arquitectura basada en cuadros de diálogo para la aplicación, con una clase de cuadro de diálogo bas
uadros de d ada en CDialog.
iálogo
Documento Crea una arquitectura de documento único para la aplicación, basada en CDocList (Clase). Esta opción sólo está
único con li disponible para plataformas que admiten esta clase, como Pocket PC.
sta de doc
Nota
CdocList no está disponible en este lanzamiento.
Vea también
Referencia
Asistente para aplicaciones de Smart Device MFC
Desarrollo para Smart Device
Vea también
Otros recursos
Referencia de la interfaz de usuario para dispositivos
Referencia a ATL para dispositivos
Desarrollo para Smart Device
Características adicionales
Se activa cuando está visible
Especifica que se crea una ventana para el control cuando éste pase a estar visible. La opción Se activa cuando está visible
está establecida de manera predeterminada. Si desea aplazar la activación del control hasta que el contenedor lo necesite
(por ejemplo, cuando se haga clic sobre él), desactive esta función. Al desactivar esta función optimizará el control, ya que
evitará la creación de una ventana hasta que sea necesario. Vea Turning off the Activate When Visible Option para obtener
más información acerca de esta opción.
No visible en tiempo de ejecución
Especifica que el control no tiene interfaz de usuario en tiempo de ejecución. Un ejemplo de control que podría ser invisible
Especifica que el control no tiene interfaz de usuario en tiempo de ejecución. Un ejemplo de control que podría ser invisible
es el Temporizador.
Tiene un cuadro de diálogo Acerca de
Especifica que el control tiene el cuadro de diálogo Acerca de estándar de Windows CE, que muestra el número de versión y
la información de copyright.
Nota
La forma de tener acceso a la ayuda del control dependerá de cómo haya implementado la ayuda y de si la integró en la ay
uda del contenedor. Vea Adding Context-Sensitive Help to an MFC ActiveX Control para obtener más información acerca d
e cómo de integrar la ayuda.
Si establece esta opción, se insertará el método de control AboutBox en la clase de control del proyecto
(CProjNameCtrl.cpp) y se agregará AboutBox al mapa de envíos del proyecto. Esta opción está establecida de forma
predeterminada.
Código de dibujo optimizado
Especifica que el contenedor restaura automáticamente los objetos GDI originales después de haber dibujado todos los
controles del contenedor, dibujados en el mismo contexto de dispositivo. Vea Optimizing Control Drawing para obtener más
información acerca de esta característica.
Activación sin ventana
Especifica que el control no genera una ventana al activarse. La activación sin ventana permite utilizar controles no
rectangulares o transparentes; además, los controles sin ventana no producen la sobrecarga del sistema que requiere un
control con ventana. Un control sin ventana no permite la activación de un contexto de dispositivo no recortado o sin
parpadeo. Los contenedores creados antes de 1996 no admiten la activación sin ventana. Vea Providing Windowless
Activation para obtener más información sobre cómo utilizar esta opción.
Contexto de dispositivo no recortado
Reemplaza COleControl::GetControlFlags en el encabezado de control (projnamectrl.h) para deshabilitar la llamada a
IntersectClipRect realizada por COleControl. Si selecciona Contexto de dispositivo no recortado, la velocidad aumentará
ligeramente. Si selecciona Activación sin ventana, esta característica no estará disponible. Vea Using an Unclipped Device
Context para obtener más información.
Activación sin parpadeo
Elimina las operaciones de dibujo y el parpadeo visual correspondiente que se produce cuando el control cambia de estado
(de activo a inactivo, o viceversa). Si selecciona Activación sin ventana, esta característica no estará disponible. Cuando se
establece esta opción, el indicador noFlickerActivate se incluye en los indicadores devueltos por
COleControl::GetControlFlags. Vea Providing Flicker-Free Activation para obtener más información.
Disponible en el cuadro de diálogo Insertar objeto
Especifica que el control estará disponible en el cuadro de diálogo Insertar objeto para contenedores habilitados. Cuando
se seleccione esta opción, se incluye el indicador afxRegInsertable en el conjunto de indicadores devuelto por
AfxOleRegisterControlClass. El cuadro de diálogo Insertar objeto permite al usuario insertar objetos existentes o recién
creados en un documento compuesto.
Notificaciones con el puntero del mouse cuando está inactivo
Habilita el procesamiento de notificaciones del puntero del mouse en el control, independientemente de si el control está
activo o no. Cuando se seleccione esta opción, se incluye el indicador pointerInactive en el conjunto de indicadores
devuelto por COleControl::GetControlFlags. Para obtener más información sobre cómo utilizar el Diseñador de tablas, vea
Providing Mouse Interaction While Inactive.
Actúa como un control de marco sencillo
Especifica que el control es un contenedor para otros controles estableciendo el bit OLEMISC_SIMPLEFRAME para el
control. Vea Contención de sitio de marco simple para obtener más información.
Cargar propiedades de forma asincrónica
Permite restablecer datos asincrónicos anteriores e iniciar una nueva carga de la propiedad asincrónica del control.
Vea también
Referencia
Asistente para controles ActiveX de Smart Device MFC
Desarrollo para Smart Device
Configurar
Abre el cuadro de diálogo Configurar transporte. Si el transporte es TCP/IP, puede utilizar un número de puerto fijo y
especificar cómo se va a definir la dirección IP. Si el botón Configurar está atenuado, se indica que el transporte
seleccionado no es configurable.
Programa previo
Especifica el programa previo.
Configurar
Para dispositivos físicos: Abre un cuadro de diálogo Configurar programa previo manual, donde puede especificar el
número de puerto y la dirección IP del dispositivo.
Si el botón Configurar aparece atenuado, el programa previo seleccionado no es configurable.
Detectar cuando el dispositivo está desconectado
Permite detectar rápidamente si un dispositivo está conectado.
Para depurar mediante KITL (Kernel Independent Transport Layer), desactive esta casilla de verificación.
Los cambios realizados en esta propiedad surten efecto en la siguiente conexión al dispositivo.
Opciones del emulador
Abre el cuadro de diálogo Propiedades del emulador, donde puede establecer las propiedades del emulador, como la
presentación y las características de conexión. Esta opción no aparece si ha seleccionado un dispositivo físico.
Vea también
Otros recursos
Referencia de la interfaz de usuario para dispositivos
Desarrollo para Smart Device
Id. de tip Establece la etiqueta para el tipo de documento en el Registro del sistema.
o de arc
hivo
Cadenas traducidas
Produce cadenas asociadas a la aplicación y el documento que leen y utilizan los usuarios de la aplicación, por lo que las
cadenas están localizadas.
Optio Description
n
Lengu Indica bajo el idioma en que se muestran las cadenas para todos los cuadros situadas bajo Cadenas traducidas. Par
aje a cambiar el valor de este cuadro, seleccione el idioma apropiado en Idioma del recurso en la página Tipo de aplica
ción del Asistente para aplicaciones de Smart Device MFC.
Título Establece el texto que aparece en la parte superior del marco principal de la aplicación. De manera predeterminada,
del m es el nombre del proyecto.
arco p
rincip
al
Nomb Identifica el tipo de documento bajo el que puede agruparse un documento de la aplicación. De manera predetermin
re del ada, es el nombre del proyecto. Cambiar el valor predeterminado no afecta a las demás opciones de este cuadro de
tipo d diálogo.
e docu
mento
Nomb Establece el nombre que los usuarios pueden indicar para buscar archivos de ese tipo de archivos. Esta opción está d
re de f isponible en las opciones Tipo de archivos y Guardar como tipo de los cuadros de diálogo estándar de Windows
iltro Abrir y Guardar como. De forma predeterminada, el nombre del proyecto más Files, seguido por la extensión espec
ificada en Extensión de archivo. Por ejemplo, si el nombre del proyecto es Widget y la extensión de archivo es .wgt
, el valor de Nombre de filtro será Widget Files (*.wgt) de manera predeterminada.
Nuevo Establece el nombre que aparece en el cuadro de diálogo Nuevo estándar de Windows, si hay más de una plantilla
nombr de documento. Si su aplicación es un servidor de automatización, se utiliza este nombre como nombre corto del obj
e cort eto de automatización. De manera predeterminada, es el nombre del proyecto.
o del a
rchivo
Nomb Establece el nombre del tipo de archivo en el Registro del sistema. Si su aplicación es un servidor de automatización,
re larg se utiliza este nombre como nombre largo del objeto de automatización. De manera predeterminada, es el nombre
o del t del proyecto más .Document.
ipo de
archiv
o
Vea también
Referencia
Asistente para aplicaciones de Smart Device MFC
Desarrollo para Smart Device
Fuente
Muestra las fuentes disponibles.
Estilo de fuente
Muestra los estilos disponibles para la fuente especificada.
Tamaño
Muestra los tamaños de punto disponibles para la fuente especificada.
Mostrar todas las fuentes
Muestra las fuentes disponibles para el proyecto de dispositivo activo. Al activar la casilla de verificación, se muestran todas
las fuentes disponibles en el equipo de desarrollo.
Tachado
Especifica si se tacha la fuente y los colores disponibles para la misma.
Subrayado
Especifica si se subraya la fuente y los colores disponibles para la misma.
Muestra
Muestra un ejemplo del aspecto que tendrá el texto con la configuración de fuente especificada.
Las fuentes disponibles para cada plataforma son las siguientes:
Pocket PC: Courier New, Tahoma
Smartphone: Nina
Windows CE: Arial, Tahoma
Vea también
Referencia
Definir color (Cuadro de diálogo, Dispositivos)
Otros recursos
Referencia de la interfaz de usuario para dispositivos
Desarrollo para Smart Device
#define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA
Este es el caso, sobre todo, de escenarios como la creación de objetos COM en plataformas de Windows Mobile, el consumo de
servicios Web en Windows Mobile y objetos COM ATL.
Vea también
Otros recursos
Crear y trasladar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
#define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA
Este es el caso, sobre todo, de escenarios como la creación de objetos COM en plataformas de Windows Mobile, el consumo de
servicios Web en Windows Mobile y objetos COM ATL.
Vea también
Otros recursos
Programar para dispositivos con Visual C++
Desarrollo para Smart Device
#define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA
Este es el caso, sobre todo, de escenarios como la creación de objetos COM en plataformas de Windows Mobile, el consumo de
servicios Web en Windows Mobile y objetos COM ATL.
Vea también
Otros recursos
Programar para dispositivos con Visual C++
Desarrollo para Smart Device
Vea también
Referencia
Asistente para proyectos ATL de Smart Device
Desarrollo para Smart Device
Vea también
Referencia
Asistente para controles ActiveX de Smart Device MFC
Desarrollo para Smart Device
Vea también
Referencia
Asistente para aplicaciones de Smart Device MFC
Desarrollo para Smart Device
Vea también
Referencia
Asistente para archivos DLL de Smart Device MFC
Desarrollo para Smart Device
Barra de estado
Esta característica no se admite en esta versión.
Implementa una barra de controles con una fila de paneles de salida de texto. No está disponible para tipos de aplicación
basados en cuadros de diálogo.
Título del cuadro de diálogo
Para aplicaciones basadas únicamente en CDialog, este título aparecerá en la barra de título del cuadro de diálogo. Para
modificar este campo, la opción Basada en cuadros de diálogo de Tipo de aplicación debe estar seleccionada. Para obtener
más información, vea Tipo de aplicación, Asistente para aplicaciones de Smart Device MFC.
Vea también
Referencia
Asistente para aplicaciones de Smart Device MFC
Desarrollo para Smart Device
#define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA
Este es el caso, sobre todo, de escenarios como la creación de objetos COM en plataformas de Windows Mobile, el consumo de
servicios Web en Windows Mobile y objetos COM ATL.
Vea también
Otros recursos
Crear y trasladar proyectos de dispositivos de Visual C++
Desarrollo para Smart Device
No se puede cargar la máscara; el archivo de imá Cualquier opción de las anteriores; la imagen no tiene formato BMP o P
genes al que hace referencia el archivo XML no s NG, los únicos formatos de imágenes que se admiten; el archivo de imá
e puede abrir genes está dañado.
No se puede cargar la máscara; el archivo XML n Para revisar los detalles de esquema de máscara válidos, vea el menú A
o contiene un esquema de máscara válido yuda en el emulador de dispositivos.